add functions to change logging settings (global\!)
parent
b9b501d391
commit
7e1007526f
|
@ -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 <iostream>
|
||||
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue