dlogg.buffered

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

Members

Classes

BufferedLogger
class BufferedLogger

Class-wrapper around strict logger. All strings are written down only after finalizing the wrapper.

Examples

  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

Meta

License

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

Authors

NCrashed <ncrashed@gmail.com>