Voting: std.logger
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Mon Sep 8 07:57:38 PDT 2014
Am Mon, 08 Sep 2014 13:37:02 +0000
schrieb "Robert burner Schadek" <rburners at gmail.com>:
> On Monday, 8 September 2014 at 13:20:27 UTC, Robert burner
> Schadek wrote:
> > On Monday, 8 September 2014 at 12:36:29 UTC, Marco Leise wrote:
>
> > I think the template bloat argument is invalid as __LINE__ and
> > friends are passed as template arguments to allow write and
> > writef type logging.
You are right, this benefit of classes doesn't apply here.
> > Anyway I will try to make them free standing
>
> The biggest problem I have currently with this that you, or at
> least I, can not override the free standing function.
>
> void log(L)(ref L logger) if(isLogger!L) { ... } will match always
> and if I create void log(L)(ref L logger) if(isMySpecialLogger!L)
> { ... }
> both match and thats a nogo
Ok, no matter what the outcome is, I'll see if I can write a
simple file logger that I can use in RAII struct dtors (where
neither allocations nor throwing seem to be an issue) and that
has a fallback to writing to stderr. I wrote earlier that I
would want a fallback logger if writing via the network fails
or the disk is full, but maybe this logic can be implemented
inside a logger implementation. I haven't actually tried your
API yet!
--
Marco
More information about the Digitalmars-d
mailing list