Review of Jose Armando Garcia Sancio's std.log

Jacob Carlborg doob at
Tue Feb 14 11:44:34 PST 2012

On 2012-02-14 17:19, Jose Armando Garcia wrote:
> On Tue, Feb 14, 2012 at 5:44 AM, Jacob Carlborg<doob at>  wrote:
>> On 2012-02-13 22:17, Sönke Ludwig wrote:
>>> 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.
>> It would be nice to be able to plug in different formatters.
> What do you mean by formatter? For example the default Logger
> (FileLogger) allow you to specify the format line see
> FileLogger.Configuration.lineFormat
> If you want to do the HTML stuff Sönke mentioned then you need to
> inherit Logger and overwrite config.logger. Mind you that the Logger
> API should be view almost like a journaling API and HTML is a document
> so the differences need to be reconciled in the implementation of
> Logger.

Yeah, I was referring to something like outputting HTML. Ok, I see.

/Jacob Carlborg

More information about the Digitalmars-d mailing list