Changeset View
Changeset View
Standalone View
Standalone View
src/logging.h
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | private: | ||||
* Log categories bitfield. | * Log categories bitfield. | ||||
*/ | */ | ||||
std::atomic<uint32_t> m_categories{0}; | std::atomic<uint32_t> m_categories{0}; | ||||
std::string LogTimestampStr(const std::string &str); | std::string LogTimestampStr(const std::string &str); | ||||
public: | public: | ||||
bool m_print_to_console = false; | bool m_print_to_console = false; | ||||
bool m_print_to_file = true; | bool m_print_to_file = false; | ||||
bool m_log_timestamps = DEFAULT_LOGTIMESTAMPS; | bool m_log_timestamps = DEFAULT_LOGTIMESTAMPS; | ||||
bool m_log_time_micros = DEFAULT_LOGTIMEMICROS; | bool m_log_time_micros = DEFAULT_LOGTIMEMICROS; | ||||
fs::path m_file_path; | |||||
std::atomic<bool> m_reopen_file{false}; | std::atomic<bool> m_reopen_file{false}; | ||||
~Logger(); | ~Logger(); | ||||
/** Send a string to the log output */ | /** Send a string to the log output */ | ||||
void LogPrintStr(const std::string &str); | void LogPrintStr(const std::string &str); | ||||
fs::path GetDebugLogPath(); | |||||
bool OpenDebugLog(); | bool OpenDebugLog(); | ||||
void ShrinkDebugFile(); | void ShrinkDebugFile(); | ||||
uint32_t GetCategoryMask() const { return m_categories.load(); } | uint32_t GetCategoryMask() const { return m_categories.load(); } | ||||
void EnableCategory(LogFlags category); | void EnableCategory(LogFlags category); | ||||
bool EnableCategory(const std::string &str); | bool EnableCategory(const std::string &str); | ||||
void DisableCategory(LogFlags category); | void DisableCategory(LogFlags category); | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |