logException

Logs an exception (including a stack trace)

@safe @safe nothrow
void
logException
(
LogLevel logLevel = LogLevel.error
LogLevel details = LogLevel.trace
)
(
Throwable exception
,
string description = "Exception"
,
int line = __LINE__
,
string file = __FILE__
,
string funcName = __FUNCTION__
,
string prettyFuncName = __PRETTY_FUNCTION__
,
string moduleName = __MODULE__
)

Examples

try
{
    // …
}
catch (Exception ex)
{
    logException(ex, "Operation XY failed.");
}
try
{
    // …
}
catch (Exception ex)
{
    logException!(LogLevel.trace)(ex);
}

Meta