Voting: std.logger

Robert burner Schadek via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 8 06:20:26 PDT 2014


On Monday, 8 September 2014 at 12:36:29 UTC, Marco Leise wrote:

>
> This may sound surprising, but I believe if we want to make
> Phobos consistent and give no incentive to roll your own
> stuff, we should do this for a lot of APIs. Without going into
> depth (but we could) there are good reasons to use classes and
> there are good reasons to use duck typing structs.
> Another API where this mixed scheme would apply are streams.
> By using function templates with `if (isLogger!T)` and an
> abstract class Logger, it will only get instantiated once for
> all derived classes reducing template bloat, while allowing
> custom instantiations for logger structs to avoid virtual
> function calls or GC issues. So I agree with Martin.
> It is a great way to bring the two camps together without
> major casualties.

I think the template bloat argument is invalid as __LINE__ and 
friends are passed as template arguments to allow write and 
writef type logging.

Anyway I will try to make them free standing


More information about the Digitalmars-d mailing list