Logger.logf
void logf(int line = __LINE__, string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__,
string moduleName = __MODULE__, A...)(const LogLevel ll,
lazy bool condition, lazy string msg, lazy A args)This function logs data to the used Logger with a specific LogLevel and depending on a condition 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 and the condition must be true.
Parameters
ll | The specific LogLevel used for logging the log message. |
condition | The condition must be true for the data to be logged. |
msg | The format string used for this log call. |
args | The data that should be logged. Example: -------------------- auto s = new FileLogger(stdout); s.logf(LogLevel.trace, true ,"%d %s", 1337, "is number"); s.logf(LogLevel.info, true ,"%d %s", 1337, "is number"); s.logf(LogLevel.warning, true ,"%d %s", 1337, "is number"); s.logf(LogLevel.error, false ,"%d %s", 1337, "is number"); s.logf(LogLevel.fatal, true ,"%d %s", 1337, "is number"); -------------------- |
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)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.
Parameters
ll | The specific LogLevel used for logging the log message. |
msg | The format string used for this log call. |
args | The data that should be logged. Example: -------------------- 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"); -------------------- |
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)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.
Parameters
condition | The condition must be true for the data to be logged. |
msg | The format string used for this log call. |
args | The data that should be logged. Example: -------------------- 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"); -------------------- |
void logf(int line = __LINE__, string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__,
string moduleName = __MODULE__, A...)(lazy string msg, lazy A args)This method logs data to the used Logger with the LogLevel of the this Logger in a printf-style manner.
In order for the data to be processed the LogLevel of the Logger must be greater or equal to the global LogLevel.
Parameters
msg | The format string used for this log call. |
args | The data that should be logged. Example: -------------------- auto s = new FileLogger(stdout); s.logf("%d %s", 1337, "is number"); s.logf("%d %s", 1337, "is number"); s.logf("%d %s", 1337, "is number"); s.logf("%d %s", 1337, "is number"); s.logf("%d %s", 1337, "is number"); -------------------- |