StyledStrictLogger

Implementation of IStyledLogger with custom style. Usually you want to use StrictLogger alias, but there are cases where you want custom styles.

Example of custom styled logger:

enum MyLevel
{
    Error,
    Debug
}

alias MyLogger = StyledStrictLogger!(MyLevel
            , MyLevel.Debug,   "Debug: %1$s",   "[%2$s] Debug: %1$s"
            , MyLevel.Error,   "Fatal: %1$s",   "[%2$s] Fatal: %1$s");

Constructors

this
this(string name, Mode mode)

Creates log at dir/name. Tries to create parent directory and all sub directories.

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

thistype
alias thistype = StyledStrictLogger!(StyleEnum, US)
Undocumented in source.

Enums

Mode
enum Mode

Option how to open logging file

Functions

finalize
void finalize()

Used to manual shutdown protocols.

initialize
void initialize(Mode mode)

Tries to create log file at location.

log
void log(string message, StyleEnum level)

Prints message into log. Displaying in the console controlled by minOutputLevel property.

minLoggingLevel
StyleEnum minLoggingLevel()

Setups minimum message level that goes to file.

minLoggingLevel
void minLoggingLevel(StyleEnum level)

Setups minimum message level that goes to file.

minOutputLevel
StyleEnum minOutputLevel()
minOutputLevel
void minOutputLevel(StyleEnum level)

Setups minimum log level,

name
string name()

Log file name.

name
void name(string value)

Setting new log file name. If the value differs from old one, logger should close old one and open new file.

rawInput
void rawInput(string message)

Unsafe write down the message without any meta information.

reload
void reload()

Checks if the log file is exists at specified location and if can't find it, recreates the file and continues write into it.

Mixins

__anonymous
mixin generateStyle!(StyleEnum, US)
Undocumented in source.

See Also

dlogg.style

Meta