dlogg.buffered

Sometimes logging is needed only if something goes wrong. This module describes a class-wrapper to handle delayed logging. *

Members

Aliases

BufferedLogger
alias BufferedLogger = StyledBufferedLogger!(LoggingLevel, LoggingLevel.Debug, "Debug: %1$s", "[%2$s]: Debug: %1$s", LoggingLevel.Notice, "Notice: %1$s", "[%2$s]: Notice: %1$s", LoggingLevel.Warning, "Warning: %1$s", "[%2$s]: Warning: %1$s", LoggingLevel.Fatal, "Fatal: %1$s", "[%2$s]: Fatal: %1$s", LoggingLevel.Muted, "", "")

Alias for StyledBufferedLogger for default logging style.

Classes

StyledBufferedLogger
class StyledBufferedLogger(StyleEnum, US...)

Class-wrapper around strict logger. All strings are written down only after finalizing the wrapper. Usually you want to use alias for standart style BufferedLogger.

Examples

1    auto delayed = new shared BufferedLogger(logger); // wrapping a logger
2 *	scope(exit) delayed.finalize(); // write down information in wrapped logger
3    scope(failure) delayed.minOutputLevel = LoggingLevel.Notice; // if failed, spam in console
4    delayed.logNotice("Hello!");
5 *
6    // do something that can fail
7 *

*

Meta

Authors

NCrashed <ncrashed@gmail.com>

License

Subject to the terms of the MIT license, as written in the included LICENSE file.