Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

std.logger.multilogger

Sourcestd/logger/multilogger.d

structMultiLoggerEntry;
This Element is stored inside theMultiLogger and associates aLogger to astring.
stringname;
The name if theLogger
Loggerlogger;
The storedLogger
classMultiLogger:std.logger.core.Logger;
MultiLogger logs to multipleLogger. TheLoggers are stored in anLogger[] in their order of insertion.
Every data logged to thisMultiLogger will be distributed to all theLoggers inserted into it. ThisMultiLogger implementation canhold multipleLoggers with the same name. If the methodremoveLoggeris used to remove aLogger only the first occurrence with that name willbe removed.
@safe this(const LogLevellv = LogLevel.all);
A constructor for theMultiLogger Logger.
Parameters:
LogLevellvTheLogLevel for theMultiLogger. By default theLogLevel forMultiLogger isLogLevel.all.

Example

auto l1 =new MultiLogger(LogLevel.trace);

protected MultiLoggerEntry[]logger;
This member holds allLoggers stored in theMultiLogger.
When inheriting fromMultiLogger this member can be used to gain access to the storedLogger.
@safe voidinsertLogger(stringname, LoggernewLogger);
This method inserts a new Logger into theMultiLogger.
Parameters:
stringnameThe name of theLogger to insert.
LoggernewLoggerTheLogger to insert.
@safe LoggerremoveLogger(in char[]toRemove);
This method removes a Logger from theMultiLogger.
Parameters:
char[]toRemoveThe name of theLogger to remove. If theLogger is not foundnull will be returned. Only the first occurrence of aLogger with the given name will be removed.
Returns:
The removedLogger.
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 00:07:36 2026

[8]ページ先頭

©2009-2026 Movatter.jp