std.logger.core

Members

Aliases

critical
alias critical = defaultLogFunction!(LogLevel.critical)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

criticalf
alias criticalf = defaultLogFunctionf!(LogLevel.critical)

This function logs data to the sharedLog in a printf-style manner.

error
alias error = defaultLogFunction!(LogLevel.error)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

errorf
alias errorf = defaultLogFunctionf!(LogLevel.error)

This function logs data to the sharedLog in a printf-style manner.

fatal
alias fatal = defaultLogFunction!(LogLevel.fatal)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

fatalf
alias fatalf = defaultLogFunctionf!(LogLevel.fatal)

This function logs data to the sharedLog in a printf-style manner.

info
alias info = defaultLogFunction!(LogLevel.info)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

infof
alias infof = defaultLogFunctionf!(LogLevel.info)

This function logs data to the sharedLog in a printf-style manner.

trace
alias trace = defaultLogFunction!(LogLevel.trace)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

tracef
alias tracef = defaultLogFunctionf!(LogLevel.trace)

This function logs data to the sharedLog in a printf-style manner.

warning
alias warning = defaultLogFunction!(LogLevel.warning)

This function logs data to the stdThreadLocalLog, optionally depending on a condition.

warningf
alias warningf = defaultLogFunctionf!(LogLevel.warning)

This function logs data to the sharedLog in a printf-style manner.

Classes

Logger
class Logger

This class is the base of every logger. In order to create a new kind of logger a deriving class needs to implement the writeLogMsg method. By default this is not thread-safe.

StdForwardLogger
class StdForwardLogger

The StdForwardLogger will always forward anything to the sharedLog.

Enums

LogLevel
enum LogLevel

There are eight usable logging level. These level are all, trace, info, warning, error, critical, fatal, and off. If a log function with LogLevel.fatal is called the shutdown handler of that logger is called.

Functions

isLoggingEnabled
bool isLoggingEnabled(LogLevel ll, LogLevel loggerLL, LogLevel globalLL, bool condition)

This functions is used at runtime to determine if a LogLevel is active. The same previously defined version statements are used to disable certain levels. Again the version statements are associated with a compile unit and can therefore not disable logging in other compile units. pure bool isLoggingEnabled()(LogLevel ll) @safe nothrow @nogc

log
void log(LogLevel ll, bool condition, A args)
void log(LogLevel ll, bool condition, T arg, int line, string file, string funcName, string prettyFuncName)

This function logs data.

log
void log(LogLevel ll, A args)
void log(LogLevel ll, T arg, int line, string file, string funcName, string prettyFuncName)

This function logs data.

log
void log(bool condition, A args)
void log(bool condition, T arg, int line, string file, string funcName, string prettyFuncName)

This function logs data.

log
void log(A args)

This function logs data.

logf
void logf(LogLevel ll, bool condition, string msg, A args)

This function logs data in a printf-style manner.

logf
void logf(LogLevel ll, string msg, A args)

This function logs data in a printf-style manner.

logf
void logf(bool condition, string msg, A args)

This function logs data in a printf-style manner.

logf
void logf(string msg, A args)

This function logs data in a printf-style manner.

Properties

globalLogLevel
LogLevel globalLogLevel [@property getter]
void globalLogLevel [@property getter]

These methods get and set the global LogLevel.

sharedLog
shared(Logger) sharedLog [@property getter]
void sharedLog [@property getter]

This property sets and gets the default Logger. Unless set to another logger by the user, the default logger's log level is LogLevel.info.

stdThreadLocalLog
Logger stdThreadLocalLog [@property getter]
void stdThreadLocalLog [@property getter]

This function returns a thread unique Logger, that by default propagates all data logged to it to the sharedLog.

Templates

defaultLogFunction
template defaultLogFunction(LogLevel ll)

This template provides the global log functions with the LogLevel is encoded in the function name.

defaultLogFunctionf
template defaultLogFunctionf(LogLevel ll)

This template provides the global printf-style log functions with the LogLevel is encoded in the function name.

Meta