Review of Jose Armando Garcia Sancio's std.log

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 6 19:04:21 PST 2012


On Tuesday, March 06, 2012 18:19:23 Jose Armando Garcia wrote:
> Fatal and Critical are exactly these continence functions... To
> reiterate. fatal will always assert and critical will always throw. It
> is impossible for the user to disable these things.

No, because they affect the log level. The concept of throwing and the log 
level should be _completely_ separate. std.log shouldn't be declaring _any_ 
exception types unless they're related to setting up the logging (_none_ which 
relate to functions which log).

Adding an extra function which logs and then throws the exception that it's 
given is fine, but that should have _nothing_ to do with the log level. 
Asserting or throwing unconditionally like std.log does now is completely 
unacceptable IMHO. Logging should _not_ affect program flow.

- Jonathan M Davis


More information about the Digitalmars-d mailing list