std.experimental.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.

Manifest constants

isLoggingActive
enum isLoggingActive;

This compile-time flag is true if logging is not statically disabled.

Properties

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

This methods get and set the global LogLevel.

sharedLog
Logger sharedLog [@property getter]
void sharedLog [@property getter]

This property sets and gets the default Logger.

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

This function returns a thread unique Logger, that by default propergates 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.

isLoggingActiveAt
template isLoggingActiveAt(LogLevel ll)

This template evaluates if the passed LogLevel is active. The previously described version statements are used to decide if the LogLevel is active. The version statements only influence the compile unit they are used with, therefore this function can only disable logging this specific compile unit.

moduleLogLevel
template moduleLogLevel(string moduleName)

This template returns the LogLevel named "logLevel" of type LogLevel defined in a user defined module where the filename has the suffix "_loggerconfig.d". This LogLevel sets the minimal LogLevel of the module.

Meta

Suggestion Box / Bug Report