mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
add a new folder structure redesign organized by packages
This commit is contained in:
@@ -13,22 +13,21 @@ enum LogLevel {
|
||||
void log(LogLevel level, const std::string& message, std::string prettyFunction = "");
|
||||
|
||||
// specialized logging
|
||||
template<class... T>
|
||||
void debug(const T&... args) { log(LogInfo, make_string(args...)); }
|
||||
template<class... T>
|
||||
void info(const T&... args) { log(LogDebug, make_string(args...)); }
|
||||
template<class... T>
|
||||
void warning(const T&... args) { log(LogWarning, make_string(args...)); }
|
||||
template<class... T>
|
||||
void error(const T&... args) { log(LogError, make_string(args...)); }
|
||||
template<class... T>
|
||||
void fatal(const T&... args) { log(LogFatal, make_string(args...)); }
|
||||
#define logDebug(...) log(LogDebug, make_string(__VA_ARGS__))
|
||||
#define logInfo(...) log(LogInfo, make_string(__VA_ARGS__))
|
||||
#define logWarning(...) log(LogWarning, make_string(__VA_ARGS__))
|
||||
#define logError(...) log(LogError, make_string(__VA_ARGS__))
|
||||
#define logFatal(...) log(LogFatal, make_string(__VA_ARGS__))
|
||||
|
||||
#define trace() log(LogDebug, "", __PRETTY_FUNCTION__)
|
||||
#define traceDebug(...) log(LogDebug, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
|
||||
#define traceInfo(...) log(LogInfo, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
|
||||
#define traceWarning(...) log(LogWarning, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
|
||||
#define traceError(...) log(LogError, make_string(__VA_ARGS__), __PRETTY_FUNCTION__)
|
||||
|
||||
// dump utility
|
||||
struct Dump {
|
||||
~Dump() { debug(s.str().c_str()); }
|
||||
~Dump() { logDebug(s.str().c_str()); }
|
||||
template<class T>
|
||||
Dump& operator<<(const T& v) { s << v << " "; return *this; }
|
||||
std::ostringstream s;
|
||||
|
Reference in New Issue
Block a user