std.experimental.logger.core.Logger.log - multiple declarations
Function Logger.log
This method logs data with the LogLevel of the used Logger.
void log(int line = __LINE__, string file = __FILE__, string funcName = __FUNCTION__, string prettyFuncName = __PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)
(
const LogLevel ll,
lazy bool condition,
lazy A args
)
if (args .length != 1);
void log(T, string moduleName = __MODULE__)
(
const LogLevel ll,
lazy bool condition,
lazy T args,
int line = __LINE__,
string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__
);
This method takes a bool as first argument. In order for the
data to be processed the bool must be true and the LogLevel
of the Logger must be greater or equal to the global LogLevel.
Parameters
| Name | Description |
|---|---|
| args | The data that should be logged. |
| condition | The condition must be true for the data to be logged. |
| args | The data that is to be logged. |
Returns
The logger used by the logging function as reference.
Example
auto l = new StdioLogger();
l .log(1337);
Function Logger.log
This function logs data to the used Logger with a specific
LogLevel.
void log(int line = __LINE__, string file = __FILE__, string funcName = __FUNCTION__, string prettyFuncName = __PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)
(
const LogLevel ll,
lazy A args
)
if (args .length > 1 && !is(Unqual!(A[0]) : bool) || args .length == 0);
void log(T)
(
const LogLevel ll,
lazy T args,
int line = __LINE__,
string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__,
string moduleName = __MODULE__
);
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
| Name | Description |
|---|---|
| ll | The specific LogLevel used for logging the log message. |
| args | The data that should be logged. |
Example
auto s = new FileLogger(stdout);
s .log(LogLevel .trace, 1337, "is number");
s .log(LogLevel .info, 1337, "is number");
s .log(LogLevel .warning, 1337, "is number");
s .log(LogLevel .error, 1337, "is number");
s .log(LogLevel .fatal, 1337, "is number");
Function Logger.log
This function logs data to the used Logger depending on a
explicitly passed condition with the LogLevel of the used
Logger.
void log(int line = __LINE__, string file = __FILE__, string funcName = __FUNCTION__, string prettyFuncName = __PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)
(
lazy bool condition,
lazy A args
)
if (args .length != 1);
void log(T)
(
lazy bool condition,
lazy T args,
int line = __LINE__,
string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__,
string moduleName = __MODULE__
);
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
| Name | Description |
|---|---|
| condition | The condition must be true for the data to be logged. |
| args | The data that should be logged. |
Example
auto s = new FileLogger(stdout);
s .log(true, 1337, "is number");
s .log(true, 1337, "is number");
s .log(true, 1337, "is number");
s .log(false, 1337, "is number");
s .log(false, 1337, "is number");
Function Logger.log
This function logs data to the used Logger with the LogLevel
of the used Logger.
void log(int line = __LINE__, string file = __FILE__, string funcName = __FUNCTION__, string prettyFuncName = __PRETTY_FUNCTION__, string moduleName = __MODULE__, A...)
(
lazy A args
)
if (args .length > 1 && !is(Unqual!(A[0]) : bool) && !is(immutable(A[0]) == immutable(LogLevel)) || args .length == 0);
void log(T)
(
lazy T arg,
int line = __LINE__,
string file = __FILE__,
string funcName = __FUNCTION__,
string prettyFuncName = __PRETTY_FUNCTION__,
string moduleName = __MODULE__
);
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.
Parameters
| Name | Description |
|---|---|
| args | The data that should be logged. |
Example
auto s = new FileLogger(stdout);
s .log(1337, "is number");
s .log(info, 1337, "is number");
s .log(1337, "is number");
s .log(1337, "is number");
s .log(1337, "is number");