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:

1    enum MyLevel
2    {
3        Error,
4        Debug
5    }
6 *
7    alias MyLogger = StyledStrictLogger!(MyLevel
8                , MyLevel.Debug,   "Debug: %1$s",   "[%2$s] Debug: %1$s"
9                , MyLevel.Error,   "Fatal: %1$s",   "[%2$s] Fatal: %1$s");

*

Constructors

this
this(string name, Mode mode = Mode.Rewrite)

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

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Enums

Mode
enum Mode

Option how to open logging file

Functions

finalize
void finalize()

Used to manual shutdown protocols.

initialize
void initialize(Mode mode = Mode.Rewrite)

Tries to create log file at location.

log
void log(lazy 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.

See Also

dlogg.style

Meta