summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-05 20:39:05 +0100
committertastytea2020-01-05 20:39:05 +0100
commitcb7dee1ab724bc9f5b8bdb311dbde08268a497a9 (patch)
tree6fa672da148c6781369012fcb139d45f94a32bc4
parent3c6c56d97335d3ccc3cc8d01b3741c248662a598 (diff)
downloadmastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.tar
mastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.tar.gz
mastodonpp-cb7dee1ab724bc9f5b8bdb311dbde08268a497a9.zip
Add errorlog.
-rw-r--r--src/log.hpp6
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