Upgrade ccapi to v6.12.0
This commit is contained in:
1 parent
8069cc893f
commit
90492733fd
109 files changed
+4172
-8930
No files matched your search
@@ -68,12 +68,12 @@
|
||||
#define CCAPI_LOGGER_FUNCTION_ENTER CCAPI_LOGGER_TRACE(std::string("enter ") + std::string(__ccapi_cpp_func__))
|
||||
#define CCAPI_LOGGER_FUNCTION_EXIT CCAPI_LOGGER_TRACE(std::string("exit ") + std::string(__ccapi_cpp_func__))
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include "ccapi_cpp/ccapi_date.h"
|
||||
#include "ccapi_cpp/ccapi_macro.h"
|
||||
#include "ccapi_cpp/ccapi_util.h"
|
||||
#include "ccapi_cpp/ccapi_util_private.h"
|
||||
namespace ccapi {
|
||||
/**
|
||||
* This class is used for library logging.
|
||||
@@ -112,21 +112,18 @@ class Logger {
|
||||
this->logMessagePrivate(LOG_SEVERITY_TRACE, threadId, time, fileName, lineNumber, message);
|
||||
}
|
||||
static Logger* logger;
|
||||
|
||||
virtual void logMessage(const std::string& severity, const std::string& threadId, const std::string& timeISO, const std::string& fileName,
|
||||
const std::string& lineNumber, const std::string& message) {}
|
||||
#ifndef CCAPI_EXPOSE_INTERNAL
|
||||
|
||||
protected:
|
||||
#endif
|
||||
virtual void logMessage(const std::string& severity, const std::string& threadId, const std::string& timeISO, const std::string& fileName,
|
||||
const std::string& lineNumber, const std::string& message) {}
|
||||
void logMessagePrivate(const std::string& severity, const std::thread::id& threadId, const std::chrono::system_clock::time_point& time,
|
||||
const std::string& fileName, const std::string& lineNumber, const std::string& message) {
|
||||
std::stringstream ss;
|
||||
ss << threadId;
|
||||
this->logMessage(severity, ss.str(), getISOTimestamp(time), fileName, lineNumber, message);
|
||||
}
|
||||
template <typename T = std::chrono::nanoseconds>
|
||||
static std::string getISOTimestamp(const TimePoint& tp, const std::string& fmt = "%FT%TZ") {
|
||||
return date::format(fmt.c_str(), date::floor<T>(tp));
|
||||
this->logMessage(severity, ss.str(), UtilTime::getISOTimestamp(time), fileName, lineNumber, message);
|
||||
}
|
||||
};
|
||||
} /* namespace ccapi */
|
||||
|
||||
Reference in new issue
Block a user