- When an unknown log level is given from a file, instead of throwing an error, default to some log level and throw a warning of some kind.
It does default to the log level you previously set. As for changing the error to a warning, I debated that, and went with the error. I can easily change that, of course, the distinction between an error and a warning is at times a bit semantic.
In assertThat, are you sure you want to throw stuff?
Yes, actually, about that one I'm dead certain
.
Thrown exceptions that aren't caught cause a crash, so you're introducing another point where the code can crash.
Which is of course the entire point of an assert. It's the "rather crash and tell me something is wrong than maybe succeed but behave weirdly and let me desperately search for what is wrong" paradigm.
The difference to a normal assert is that you get log output, which is indispensible when people are testing your code that are not building and running it in visual studio themselves. Because in that case, you just get cryptic windows messages from standard asserts or exceptions, which sucks.
That said, maybe there is also a small misunderstanding here. assertThat is simply a bonus which you might or might not want to use (I happen to desperately need it, so desperately that it was the first thing I wrote of the entire library...). Just logging an error will not throw anything, as you'd expect it just logs.