Early review of std.logger

Robert Schadek realburner at gmx.de
Tue Oct 15 07:20:05 PDT 2013


On 10/15/2013 04:12 PM, Sönke Ludwig wrote:
>
> Believe it or not, for some reason I suspected as much.
>
> Yes, but the point is that when looking only at func1, you might
> expect that all messages are logged as debug messages, but the last
> one will be logged as a warning instead. func2 may be hidden in
> library where the function body is not readily available.
Logging is the most unpure functionality I can think of. It is side
effect heaven.
>
> But if it's available people _will_ use it in complex contexts. Also
> if the writer of a 2<<8 loc library uses it and the library is used by
> a large piece of software, that will also be affected. The point is
> that it is unhygienic and requires non-trivial extra work when using a
> logger in a multi-threaded environment. Some kind of scoped stack of
> default log levels would get around this issue, but that smells like
> over engineering.
>
>
> But these are two different concepts and it's hard for me to imagine
> why they should be conflated. But I guess it's time to stop
> complaining about the whole log("message") complex.
...


More information about the Digitalmars-d mailing list