StrictLogger

Standard implementation of IStyledLogger interface.

  1. alias StrictLogger = StyledStrictLogger!(LoggingLevel, LoggingLevel.Debug, "Debug:".color(fg.light_magenta) ~ " %1$s", "[%2$s]: Debug: %1$s", LoggingLevel.Notice, "Notice:".color(fg.light_green) ~ " %1$s", "[%2$s]: Notice: %1$s", LoggingLevel.Warning, "Warning:".color(fg.light_yellow) ~ " %1$s", "[%2$s]: Warning: %1$s", LoggingLevel.Fatal, "Fatal:".color(fg.light_red) ~ " %1$s", "[%2$s]: Fatal: %1$s", LoggingLevel.Muted, "", "")
  2. alias StrictLogger = StyledStrictLogger!(LoggingLevel, LoggingLevel.Debug, "Debug:".color(fg.magenta) ~ " %1$s", "[%2$s]: Debug: %1$s", LoggingLevel.Notice, "Notice:".color(fg.green) ~ " %1$s", "[%2$s]: Notice: %1$s", LoggingLevel.Warning, "Warning:".color(fg.light_yellow) ~ " %1$s", "[%2$s]: Warning: %1$s", LoggingLevel.Fatal, "Fatal:".color(fg.light_red) ~ " %1$s", "[%2$s]: Fatal: %1$s", LoggingLevel.Muted, "", "")
    alias StrictLogger = StyledStrictLogger!(LoggingLevel, LoggingLevel.Debug, "Debug:".color(fg.magenta) ~ " %1$s", "[%2$s]: Debug: %1$s", LoggingLevel.Notice, "Notice:".color(fg.green) ~ " %1$s", "[%2$s]: Notice: %1$s", LoggingLevel.Warning, "Warning:".color(fg.light_yellow) ~ " %1$s", "[%2$s]: Warning: %1$s", LoggingLevel.Fatal, "Fatal:".color(fg.light_red) ~ " %1$s", "[%2$s]: Fatal: %1$s", LoggingLevel.Muted, "", "")
  3. alias StrictLogger = StyledStrictLogger!(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, "", "")

Examples

1 shared ILogger logger = new StrictLogger("my_awesome_log.log");
2 logger.minOutputLevel = LoggingLevel.Warning; // info msgs won't be printed in console
3 logger.logInfo("Info message!");
4 logger.logError("Error message!");
5 logger.logDebug("Debug message!");
6 
7 // received USR1 signal from logrotate
8 logger.reload;

Meta