StrictLogger

Standard implementation of ILogger interface.

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

Enums

Mode
enum Mode

Option how to open logging file

Functions

finalize
void finalize()

Used to manual shutdown protocols.

formatString
string formatString(string message, LoggingLevel level)

Format message with default logging style (etc. time and level string).

initialize
void initialize(Mode mode)

Tries to create log file at location.

log
void log(string message, LoggingLevel level)

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

minOutputLevel
LoggingLevel minOutputLevel()
minOutputLevel
void minOutputLevel(LoggingLevel 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.

Examples

shared ILogger logger = new StrictLogger("my_awesome_log.log");
logger.minOutputLevel = LoggingLevel.Warning; // info msgs won't be printed in console 
logger.logInfo("Info message!");
logger.logError("Error message!");
logger.logDebug("Debug message!");

// received USR1 signal from logrotate
logger.reload;

Meta