dlogg.log

Logging system designed to operate in concurrent application. * The system should be initialized with initLoggingSystem function. There is no need to call shutdown function as it is happen in module destructor. *

Members

Aliases

ILogger
alias ILogger = IStyledLogger!(LoggingLevel)

Default logger interface that uses LoggingLevel as enum that describes ordering of logging levels.

Enums

LoggingLevel
enum LoggingLevel

Log levels defines style of the messages. Printing in console can be controlled by ILogger.minOutputLevel property.

Functions

logDebug
void logDebug(shared ILogger logger, E args)

Wrapper for handy debug messages. Warning: main purpose for debug messages, thus it is not lazy.

logError
void logError(shared ILogger logger, E args)

Not lazy wrapper for multiple args messages

logError
void logError(shared ILogger logger, lazy string message)

Lazy wrapper for one string message

logInfo
void logInfo(shared ILogger logger, E args)

Not lazy wrapper for multiple args messages

logInfo
void logInfo(shared ILogger logger, lazy string message)

Lazy wrapper for one string message

logWarning
void logWarning(shared ILogger logger, E args)

Not lazy wrapper for multiple args messages

logWarning
void logWarning(shared ILogger logger, lazy string message)

Lazy wrapper for one string message

Interfaces

IStyledLogger
interface IStyledLogger(StyleEnum)

Interface for lazy logging. Assumes to be nothrow. Underlying realization should be concurrent safe. * StyleEnum is enum that used to distinct logging levels and define ordering for verbosity muting.

Examples

1     void testThread()
2     {
3         foreach(j; 1 .. 50)
4         {
5             logInfo(to!string(j));
6             logError(to!string(j));
7         }
8     }    
9 *
10     foreach(i; 1 .. 50)
11     {
12         spawn(&testThread);
13     }

*

Meta

Authors

NCrashed <ncrashed@gmail.com> *

License

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