modify logs
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -695,9 +696,23 @@ inline std::string sanitize(std::string s) {
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// 当前本地时间,格式 "YYYY-MM-DD HH:MM:SS"
|
||||
inline std::string now_yyyy_mm_dd_hh_mm_ss() {
|
||||
std::time_t t = std::time(nullptr);
|
||||
std::tm tmv;
|
||||
#if defined(_WIN32)
|
||||
localtime_s(&tmv, &t); // Windows 线程安全
|
||||
#else
|
||||
localtime_r(&t, &tmv); // POSIX 线程安全
|
||||
#endif
|
||||
std::ostringstream oss;
|
||||
oss << std::put_time(&tmv, "%Y-%m-%d %H:%M:%S");
|
||||
return oss.str();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
extern int g_front_seg_index;
|
||||
extern std::string FRONT_IP;
|
||||
extern std::string FRONT_INST;
|
||||
extern std::string FRONT_PATH;
|
||||
|
||||
extern std::string WEB_FILEUPLOAD;
|
||||
|
||||
Reference in New Issue
Block a user