std.experimental.logger

Mike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 4 19:01:14 PST 2016


On Tuesday, 5 January 2016 at 02:59:04 UTC, sanjayss wrote:
> On Tuesday, 5 January 2016 at 02:49:01 UTC, Mike wrote:
>> [...]
>
> Thanks, that works. But the docs are confusing -- it gives the 
> impression that "sharedLog" is something associated with the 
> default logger -- so I would expect the above to work with just 
> the plain log() call to invoke the default logger. But it seems 
> like I am just creating a new logger and using that by saying 
> "sharedLog.log()".
>
> From the doc:
>
> The default Logger will by default log to stderr and has a 
> default LogLevel of LogLevel.all. The default Logger can be 
> accessed by using the property called sharedLog. This property 
> a reference to the current default Logger. This reference can 
> be used to assign a new default Logger.
>
> sharedLog = new FileLogger("New_Default_Log_File.log");

You are right, according to the docs your example should've 
worked just fine. Tried it myself on DMD 2.069.2 and it doesn't 
work either. You should raise an issue on github.


More information about the Digitalmars-d-learn mailing list