Logger.logf

This function logs data to the used Logger depending on a condition with the LogLevel of the used Logger in a printf-style manner.

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

  1. void logf(LogLevel ll, bool condition, string msg, A args)
  2. void logf(LogLevel ll, string msg, A args)
  3. void logf(bool condition, 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...
    )
    (
    lazy bool condition
    ,
    lazy string msg
    ,
    lazy A args
    )
  4. void logf(string msg, A args)

Parameters

condition bool

The condition must be true for the data to be logged.

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(true ,"%d %s", 1337, "is number");
s.logf(true ,"%d %s", 1337, "is number");
s.logf(true ,"%d %s", 1337, "is number");
s.logf(false ,"%d %s", 1337, "is number");
s.logf(true ,"%d %s", 1337, "is number");

Meta

Suggestion Box / Bug Report