17 #ifndef MASTODONPP_LOG_HPP
18 #define MASTODONPP_LOG_HPP
21 #include <string_view>
27 using std::string_view;
30 constexpr
auto shorten_filename(
const string_view &filename)
32 for (
const string_view dir : {
"/src/",
"/include/"})
34 const auto pos{filename.rfind(dir)};
35 if (pos != string_view::npos)
37 return filename.substr(pos + dir.size());
45 cerr << '[' << shorten_filename(__FILE__) << ':' << __LINE__ << ']'
48 # define debuglog commonlog << " DEBUG: "
50 # define debuglog false && cerr
53 #define errorlog commonlog << " ERROR: "
C++ wrapper for the Mastodon API.
Definition: api.hpp:25