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.

Public Imports

std.conv
public import std.conv;
Undocumented in source.

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(ILogger logger, E args)

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

logError
void logError(ILogger logger, E args)

Not lazy wrapper for multiple args messages

logError
void logError(ILogger logger, string message)

Lazy wrapper for one string message

logInfo
void logInfo(ILogger logger, E args)

Not lazy wrapper for multiple args messages

logInfo
void logInfo(ILogger logger, string message)

Lazy wrapper for one string message

logWarning
void logWarning(ILogger logger, E args)

Not lazy wrapper for multiple args messages

logWarning
void logWarning(ILogger logger, 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.

Examples

void testThread()
{
    foreach(j; 1 .. 50)
    {
        logInfo(to!string(j));
        logError(to!string(j));
    }
}    

foreach(i; 1 .. 50)
{
    spawn(&testThread);
}

Meta

License

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

Authors

NCrashed <ncrashed@gmail.com>