diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h index 5934b9c..8f661d8 100755 --- a/include/blt/std/logging.h +++ b/include/blt/std/logging.h @@ -125,9 +125,13 @@ namespace blt::logging { void flush(); void setThreadName(const std::string& name); + void setLogFormat(const log_format& format); + void setLogColor(log_level level, const std::string& newFormat); + void setLogName(log_level level, const std::string& newFormat); + void setLogOutputFormat(const std::string& newFormat); } -//#define BLT_LOGGING_IMPLEMENTATION +#define BLT_LOGGING_IMPLEMENTATION #ifdef BLT_LOGGING_IMPLEMENTATION #include @@ -457,6 +461,19 @@ namespace blt::logging { loggingThreadNames[std::this_thread::get_id()] = name; } + void setLogFormat(const log_format& format){ + loggingFormat = format; + } + void setLogColor(log_level level, const std::string& newFormat){ + loggingFormat.levelColors[(int)level] = newFormat; + } + void setLogName(log_level level, const std::string& newFormat){ + loggingFormat.levelNames[(int)level] = newFormat; + } + void setLogOutputFormat(const std::string& newFormat){ + loggingFormat.logOutputFormat = newFormat; + } + void flush() { std::cerr.flush(); std::cout.flush();