diff options
author | tastytea | 2020-01-05 20:39:05 +0100 |
---|---|---|
committer | tastytea | 2020-01-05 20:39:05 +0100 |
commit | cb7dee1ab724bc9f5b8bdb311dbde08268a497a9 (patch) | |
tree | 6fa672da148c6781369012fcb139d45f94a32bc4 | |
parent | 3c6c56d97335d3ccc3cc8d01b3741c248662a598 (diff) | |
download | mastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.tar mastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.tar.gz mastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.zip |
Add errorlog.
-rw-r--r-- | src/log.hpp | 6 |
1 files 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 |