Use logException consistently and use logDiagnostic
Many places around were re-inventing logException with varying level of success.
In addition, the full error is now printed as a diagnostic instead of debug.
This is more in line with the description of `LogLevel.diagnostic`
("Extended user information (e.g. for more detailed error information)"),
as opposed to the one of `LogLevel.debug_`
("Developer information useful for algorithm debugging").
This commit is contained in:
parent
f3accb40d5
commit
bd8c2c6e90
6 changed files with 14 additions and 24 deletions
|
|
@ -102,9 +102,8 @@ int runApplication(string[]* args_out = null)
|
|||
version (VibeDebugCatchAll) {
|
||||
try {
|
||||
status = runEventLoop();
|
||||
} catch( Throwable th ){
|
||||
logError("Unhandled exception in event loop: %s", th.msg);
|
||||
logDiagnostic("Full exception: %s", th.toString().sanitize());
|
||||
} catch (Throwable th) {
|
||||
th.logException("Unhandled exception in event loop");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -908,9 +907,7 @@ Timer setTimer(Duration timeout, void delegate() callback, bool periodic = false
|
|||
return setTimer(timeout, () @trusted nothrow {
|
||||
try callback();
|
||||
catch (Exception e) {
|
||||
logWarn("Timer callback failed: %s", e.msg);
|
||||
scope (failure) assert(false);
|
||||
logDebug("Full error: %s", e.toString().sanitize);
|
||||
e.logException!(LogLevel.warn)("Timer callback failed");
|
||||
}
|
||||
}, periodic);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue