cspot fixes - release

This commit is contained in:
philippe44
2023-10-06 23:38:07 -07:00
parent e3650413f5
commit 61f58f9a52
11 changed files with 106 additions and 76 deletions

View File

@@ -14,6 +14,7 @@ class AbstractLogger {
public:
bool enableSubmodule = false;
bool enableTimestamp = false;
bool shortTime = false;
virtual void debug(std::string filename, int line, std::string submodule,
const char* format, ...) = 0;
@@ -94,10 +95,18 @@ class BellLogger : public bell::AbstractLogger {
now.time_since_epoch()) %
1000;
auto gmt_time = gmtime(&now_time);
printf(colorReset);
std::cout << std::put_time(gmt_time, "[%Y-%m-%d %H:%M:%S") << '.'
<< std::setfill('0') << std::setw(3) << nowMs.count() << "] ";
struct tm* gmt_time;
if (shortTime) {
gmt_time = localtime(&now_time);
std::cout << std::put_time(gmt_time, "[%H:%M:%S") << '.'
<< std::setfill('0') << std::setw(3) << nowMs.count() << "] ";
}
else {
gmt_time = gmtime(&now_time);
std::cout << std::put_time(gmt_time, "[%Y-%m-%d %H:%M:%S") << '.'
<< std::setfill('0') << std::setw(3) << nowMs.count() << "] ";
}
}
}
@@ -129,7 +138,7 @@ class BellLogger : public bell::AbstractLogger {
void setDefaultLogger();
void enableSubmoduleLogging();
void enableTimestampLogging();
void enableTimestampLogging(bool local = false);
} // namespace bell
#define BELL_LOG(type, ...) \