Voting: std.logger
Dicebot via Digitalmars-d
digitalmars-d at puremagic.com
Mon Sep 1 09:30:45 PDT 2014
On Sunday, 31 August 2014 at 01:09:33 UTC, Ola Fosheim Grøstad
wrote:
> I've got some questions:
>
> How does logging interact with pure? You need to be able to log
> in pure functions.
Weakly pure function can take logger as an argument (so I doubt
it is useful in practice). Strongly pure functions can't be
logged in non-debug statement pretty much by D definition of
purity. This may be or may not be an issue but is definitely goes
out of the scope of this Phobos proposal. If you have any
specific ideas how to address it, please create a separate thread.
> Does the logger implementation flush() in the case of a crash?
> (Does it trap all crashes in a way that ensures that logging
> buffers are written to disk?)
Current implementations use basic std.stdio facilities and those
flush upon writing a newline symbol -> flush happens after each
log call. More efficient buffered implementation can be provided
later, this shouldn't affect the API.
> Is logf() needed? Can't you somehow detect that the string is
> an immutable string literal with string formatting characters?
Unreliable, not KISS. I think it is a bad idea.
More information about the Digitalmars-d
mailing list