std.experimental.logger formal review round 3

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 12 09:56:06 PST 2014


On Wednesday, 12 November 2014 at 12:39:24 UTC, Robert burner 
Schadek wrote:
> Only one thread can write to one Logger at a time, also known 
> as synchronization. Anything else is properly wrong. But you 
> can have as many Logger as you have memory.

One thing we can improve is to use thread-local stdlog singletons 
(that forward to global shared one by default) instead of using 
shared one as entry point. In server applications one would 
typically want to have logs buffered per thread or even sent to 
remote process / machine in parallel - while this can be done 
right now it would require applications to resort from using 
stdlog completely.

Better approach that comes to my mind is to have both 
thread-local and global configurable stdlog and have means to 
explicitly capture lock on global one from local proxies for 
optimized bulk logging.


More information about the Digitalmars-d mailing list