View source code
Display the source code in std/experimental/logger/core.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module std.experimental.logger.core

Functions

NameDescription
globalLogLevel() This methods get and set the global LogLevel.
isLoggingEnabled(ll, loggerLL, globalLL, 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(ll, condition, args) This function logs data.
log(ll, args) This function logs data.
log(condition, args) This function logs data.
log(args) This function logs data.
logf(ll, condition, msg, args) This function logs data in a printf-style manner.
logf(ll, msg, args) This function logs data in a printf-style manner.
logf(condition, msg, args) This function logs data in a printf-style manner.
logf(msg, args) This function logs data in a printf-style manner.
sharedLog() This property sets and gets the default Logger.
stdThreadLocalLog() This function returns a thread unique Logger, that by default propergates all data logged to it to the sharedLog.

Classes

NameDescription
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 The StdForwardLogger will always forward anything to the sharedLog.

Enums

NameDescription
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.

Templates

NameDescription
defaultLogFunction This template provides the global log functions with the LogLevel is encoded in the function name.
defaultLogFunctionf This template provides the global printf-style log functions with the LogLevel is encoded in the function name.
moduleLogLevel 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.

Manifest constants

NameTypeDescription
isLoggingActive This compile-time flag is true if logging is not statically disabled.
isLoggingActiveAt 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 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.

Aliases

NameTypeDescription
critical defaultLogFunction!(LogLevel.critical) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
criticalf defaultLogFunctionf!(LogLevel.critical) This function logs data to the sharedLog in a printf-style manner.
error defaultLogFunction!(LogLevel.error) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
errorf defaultLogFunctionf!(LogLevel.error) This function logs data to the sharedLog in a printf-style manner.
fatal defaultLogFunction!(LogLevel.fatal) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
fatalf defaultLogFunctionf!(LogLevel.fatal) This function logs data to the sharedLog in a printf-style manner.
info defaultLogFunction!(LogLevel.info) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
infof defaultLogFunctionf!(LogLevel.info) This function logs data to the sharedLog in a printf-style manner.
trace defaultLogFunction!(LogLevel.trace) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
tracef defaultLogFunctionf!(LogLevel.trace) This function logs data to the sharedLog in a printf-style manner.
warning defaultLogFunction!(LogLevel.warning) This function logs data to the stdThreadLocalLog, optionally depending on a condition.
warningf defaultLogFunctionf!(LogLevel.warning) This function logs data to the sharedLog in a printf-style manner.

Authors

License