From cb7dee1ab724bc9f5b8bdb311dbde08268a497a9 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 5 Jan 2020 20:39:05 +0100 Subject: Add errorlog. --- src/log.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/log.hpp b/src/log.hpp index 43d4fc4..ab8c033 100644 --- a/src/log.hpp +++ b/src/log.hpp @@ -39,12 +39,14 @@ constexpr auto shorten_filename(const string_view &filename) return filename; } +#define commonlog cerr << '[' << shorten_filename(__FILE__) \ + << ':' << __LINE__ << ']' #ifndef NDEBUG -#define debuglog cerr << "[" << shorten_filename(__FILE__) \ - << ':' << __LINE__ << "] DEBUG: " +#define debuglog commonlog << " DEBUG: " #else #define debuglog false && cerr #endif +#define errorlog commonlog << " ERROR: " } // namespace mastodonpp -- cgit v1.2.3-54-g00ecf