std.experimental.logger.multilogger
- struct MultiLoggerEntry;
-
This Element is stored inside the
MultiLoggerand associates aLoggerto astring.- string name;
-
The name if the
Logger - Logger logger;
-
The stored
Logger
- class MultiLogger: std.experimental.logger.core.Logger;
-
MultiLogger logs to multiple
Logger. TheLoggers are stored in anLogger[]in their order of insertion.Every data logged to this
MultiLoggerwill be distributed to all theLoggers inserted into it. ThisMultiLoggerimplementation can hold multipleLoggers with the same name. If the methodremoveLoggeris used to remove aLoggeronly the first occurrence with that name will be removed.- @safe this(const LogLevel lv = LogLevel.all);
-
A constructor for the
MultiLoggerLogger.- Parameters:
LogLevel lvThe LogLevelfor theMultiLogger. By default theLogLevelforMultiLoggerisLogLevel.all.
- Example
auto l1 = new MultiLogger(LogLevel.trace);
- protected MultiLoggerEntry[] logger;
-
This member holds all
Loggers stored in theMultiLogger.When inheriting from
MultiLoggerthis member can be used to gain access to the storedLogger. - @safe void insertLogger(string name, Logger newLogger);
-
This method inserts a new Logger into the
MultiLogger.- Parameters:
string nameThe name of the Loggerto insert.Logger newLoggerThe Loggerto insert.
- @safe Logger removeLogger(in char[] toRemove);
-
This method removes a Logger from the
MultiLogger.- Parameters:
char[] toRemoveThe name of the Loggerto remove. If theLoggeris not foundnullwill be returned. Only the first occurrence of aLoggerwith the given name will be removed.
- Returns:
- The removed
Logger.
© 1999–2021 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/phobos/std_experimental_logger_multilogger.html