Review of Jose Armando Garcia Sancio's std.log

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Feb 13 22:50:49 PST 2012


On 2/13/12 9:50 AM, David Nadlinger wrote:
> Please post all feedback in this thread, and remember: Although
> comprehensive reviews are obviously appreciated, short comments are very
> welcome as well!

Thanks Jose and David. I made a pass, here are a few thoughts:

* "different verbose level" -> "different verbosity levels"

* "functionality to disabled and enabled" -> "functionality to disable 
and enable"

* "enviroment variables, and their meaning see" -> "enviroment variables 
and their meaning, see"

* In code example: "Every nine" -> "Write every 9 passes"

* In code example: unbraced try statement is odd. We should use our own 
conventions in examples.

* In code example: plant an assert(false, "Never reached") after log!fatal.

* first() and every() are quite useful. I'm thinking of complementing 
them with after(). "Once" is first(1).

* "Descripton of the supported severities." -> "Description of supported 
severities." (notice the typo too)

* vlog should take uint, not int.

* When passing multiple parameters to log, they must be stringized 
automatically. So

log!error("Log an ", to!string(Severity.error), " message!");

becomes

log!error("Log an ", Severity.error, " message!");

* The examples right inside LogFilter don't mention it at all. I assume 
log!xyz has type LogFilter or something. That must be stated in writing.

* log!info.when(first())("Only log this the first time in the loop") 
should really be log!info.when(first())("Only log this one time per 
application run").

* No examples include durations.

* There might be a better name for Rich.

* assert(value == true); => assert(value);


Andrei


More information about the Digitalmars-d mailing list