Review of Jose Armando Garcia Sancio's std.log

Sönke Ludwig ludwig at informatik.uni-luebeck.de
Mon Feb 13 13:17:35 PST 2012


Log levels "debug" and maybe also "trace" would be useful, but I see 
that vlog(n)() is meant for that purpose. I would just prefer explicit 
names instead of just numbers.

Is there a compelling reason why formatted logging is not the default? I 
find that most logging calls in practice use formatted output, and the 
only overhead would be searching once through the format string in the 
case of format placeholders.

A predefined logger for OutputDebugString on Windows would be useful - 
or maybe it could be used instead of stdout at least for non-console 
applications.

One kind of log writer that I have in my code is one that outputs a 
nicely formatted HTML file with built-in JavaScript to be able to filter 
messages by priority or module. Maybe this is too much for a standard 
library implementation though.

Support for multiple log writers can be useful (e.g. logging to a file + 
logging to stdout or to a log control inside of the running 
application). Of course, one can also simply write a 
"MultiDispatchLogger"...

A format option to log the thread name instead of just the ID.


More information about the Digitalmars-d mailing list