From 86d11c73f637f5e858ecb84fe6dfb90281f266a9 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 18 Jan 2015 13:28:15 +0100 Subject: Allowing to override location when logging exceptions. --- src/core/common/Logger.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/core/common/Logger.hpp b/src/core/common/Logger.hpp index b365a39..767d8ab 100644 --- a/src/core/common/Logger.hpp +++ b/src/core/common/Logger.hpp @@ -242,6 +242,16 @@ public: log(Severity::ERROR, ex.msg, ex.getLocation()); } + /** + * Logs the given loggable exception at the given location. + * + * @param ex is the exception that should be logged. + */ + void log(const LoggableException &ex, const SourceLocation &loc) + { + log(Severity::ERROR, ex.msg, loc.valid() ? loc : ex.getLocation()); + } + /** * Logs the given message. The file name is set to the topmost file name on * the file name stack. -- cgit v1.2.3