diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-05 12:36:05 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2014-12-05 12:36:05 +0100 |
commit | 9cb01624a4efe2063d5870f41e033476d9368b6d (patch) | |
tree | f1274db2a713f11780d13f94ddff0dbde9805be9 /src/core/Logger.hpp | |
parent | 0a4fbfe17951498f9a5f650f6da81d90f4a533b4 (diff) | |
parent | a23c51bcb1b8d85b1ea06a7a16729fa4b87d8fd4 (diff) |
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/core/Logger.hpp')
-rw-r--r-- | src/core/Logger.hpp | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/core/Logger.hpp b/src/core/Logger.hpp index a30374c..fd7bb08 100644 --- a/src/core/Logger.hpp +++ b/src/core/Logger.hpp @@ -241,6 +241,23 @@ public: } /** + * Logs the given message. The file name is set to the topmost file name on + * the file name stack. + * + * @param severity is the severity of the log message. + * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + * @tparam PosType is the actual type of pos and must implement a getLine + * and getColumn function. + */ + template<class PosType> + void logAt(Severity severity, const std::string &msg, const PosType &pos) + { + log(severity, msg, pos.getLine(), pos.getColumn()); + } + + /** * Logs the given loggable exception. * * @param ex is the exception that should be logged. @@ -283,6 +300,21 @@ public: } /** + * Logs a debug message. The file name is set to the topmost file name on + * the file name stack. + * + * @param severity is the severity of the log message. + * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + */ + template<class PosType> + void debugAt(const std::string &msg, const PosType &pos) + { + debug(msg, pos.getLine(), pos.getColumn()); + } + + /** * Logs a note. The file name is set to the topmost file name on * the file name stack. * @@ -314,6 +346,20 @@ public: } /** + * Logs a note. The file name is set to the topmost file name on + * the file name stack. + * + * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + */ + template<class PosType> + void noteAt(const std::string &msg, const PosType &pos) + { + note(msg, pos.getLine(), pos.getColumn()); + } + + /** * Logs a warning. The file name is set to the topmost file name on * the file name stack. * @@ -334,6 +380,20 @@ public: * the file name stack. * * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + */ + template<class PosType> + void warningAt(const std::string &msg, const PosType &pos) + { + warning(msg, pos.getLine(), pos.getColumn()); + } + + /** + * Logs a warning. The file name is set to the topmost file name on + * the file name stack. + * + * @param msg is the actual log message. * @param line is the line in the above file at which the error occured. * Ignored if negative. * @param column is the column in the above file at which the error occured. @@ -376,6 +436,20 @@ public: } /** + * Logs an error message. The file name is set to the topmost file name on + * the file name stack. + * + * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + */ + template<class PosType> + void errorAt(const std::string &msg, const PosType &pos) + { + error(msg, pos.getLine(), pos.getColumn()); + } + + /** * Logs a fatal error. The file name is set to the topmost file name on * the file name stack. * @@ -407,6 +481,20 @@ public: } /** + * Logs a fatal error. The file name is set to the topmost file name on + * the file name stack. + * + * @param msg is the actual log message. + * @param pos is a const reference to a variable which provides position + * information. + */ + template<class PosType> + void fatalErrorAt(const std::string &msg, const PosType &pos) + { + fatalError(msg, pos.getLine(), pos.getColumn()); + } + + /** * Pushes a new file name onto the internal filename stack. * * @param name is the name of the file that should be added to the filename |