// // ****************************************************************** // // /\ /| @File Loger.h // // \ V/ @Brief // // | "") @Author lijinwen, ghz005@uni-trend.com.cn // // / | @Creation 2024-05-16 // // / \\ @Modified 2024-06-24 // // *(__\_\ // // ****************************************************************** #pragma once #include #include #include #include #include #include #include #include #include #include // 对于std::put_time的tm结构体定义 #include "../BaseEnums/loger_enums.h" namespace Fs = std::filesystem; namespace Protocol { class Loger { public: Loger(); static void Log(const std::string& message); ~Loger(); inline static auto logLevel = LogLevel::All; private: std::string logPath_; std::string logFileName_; // The full path and filename of the log file. std::ofstream logFile_; static std::mutex instanceMutex_; static Loger instance_; Loger(const Loger&) = delete; Loger& operator=(const Loger&) = delete; }; void WriteLog(LogLevel level, const char* format, ...); }