dlogg

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

Example:
auto delayed = new shared BufferedLogger(logger); // wrapping a logger
scope(exit) delayed.finalize(); // write down information in wrapped logger
scope(failure) delayed.minOutputLevel = LoggingLevel.Notice; // if failed, spam in console
delayed.logNotice("Hello!");

// do something that can fail

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

alias  BufferedLogger = StyledBufferedLogger!(LoggingLevel, cast(LoggingLevel)2, "Debug: %1$s", "[%2$s]: Debug: %1$s", cast(LoggingLevel)0, "Notice: %1$s", "[%2$s]: Notice: %1$s", cast(LoggingLevel)1, "Warning: %1$s", "[%2$s]: Warning: %1$s", cast(LoggingLevel)3, "Fatal: %1$s", "[%2$s]: Fatal: %1$s", cast(LoggingLevel)4, "", "").StyledBufferedLogger;

Alias for StyledBufferedLogger for default logging style.


class  StyledBufferedLogger(StyleEnum, US...): StyledStrictLogger!(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.