stdThreadLocalLog

This function returns a thread unique Logger, that by default propagates all data logged to it to the sharedLog.

These properties can be used to set and get this Logger. Every modification to this Logger will only be visible in the thread the modification has been done from.

This Logger is called by the free standing log functions. This allows to create thread local redirections and still use the free standing log functions.

  1. Logger stdThreadLocalLog [@property getter]
  2. void stdThreadLocalLog [@property getter]
    @property @safe
    void
    stdThreadLocalLog

Examples

Ditto

import std.logger.filelogger : FileLogger;
import std.file : deleteme, remove;
Logger l = stdThreadLocalLog;
stdThreadLocalLog = new FileLogger(deleteme ~ "-someFile.log");
scope(exit) remove(deleteme ~ "-someFile.log");

auto tempLog = stdThreadLocalLog;
stdThreadLocalLog = l;
destroy(tempLog);

Meta