diff options
-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 |