Logger.logf

This function logs data to the used Logger with a specific LogLevel in a printf-style manner.

In order for the resulting log message to be logged the LogLevel must be greater or equal than the LogLevel of the used Logger and must be greater or equal than the global LogLevel.

  1. void logf(LogLevel ll, bool condition, string msg, A args)
  2. void logf(LogLevel ll, string msg, A args)
    class Logger
    void
    logf
    (
    int line = __LINE__
    string file = __FILE__
    string funcName = __FUNCTION__
    string prettyFuncName = __PRETTY_FUNCTION__
    string moduleName = __MODULE__
    A...
    )
    (
    const LogLevel ll
    ,
    lazy string msg
    ,
    lazy A args
    )
  3. void logf(bool condition, string msg, A args)
  4. void logf(string msg, A args)

Parameters

ll LogLevel

The specific LogLevel used for logging the log message.

msg string

The format string used for this log call.

args A

The data that should be logged.

Examples

auto s = new FileLogger(stdout);
s.logf(LogLevel.trace, "%d %s", 1337, "is number");
s.logf(LogLevel.info, "%d %s", 1337, "is number");
s.logf(LogLevel.warning, "%d %s", 1337, "is number");
s.logf(LogLevel.error, "%d %s", 1337, "is number");
s.logf(LogLevel.fatal, "%d %s", 1337, "is number");

Meta