Changeset View
Changeset View
Standalone View
Standalone View
src/logging.h
Show All 13 Lines | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <list> | #include <list> | ||||
#include <mutex> | #include <mutex> | ||||
#include <string> | #include <string> | ||||
static const bool DEFAULT_LOGTIMEMICROS = false; | static const bool DEFAULT_LOGTIMEMICROS = false; | ||||
static const bool DEFAULT_LOGIPS = false; | static const bool DEFAULT_LOGIPS = false; | ||||
static const bool DEFAULT_LOGTIMESTAMPS = true; | static const bool DEFAULT_LOGTIMESTAMPS = true; | ||||
static const bool DEFAULT_LOGTHREADNAMES = false; | |||||
extern bool fLogIPs; | extern bool fLogIPs; | ||||
extern const char *const DEFAULT_DEBUGLOGFILE; | extern const char *const DEFAULT_DEBUGLOGFILE; | ||||
struct CLogCategoryActive { | struct CLogCategoryActive { | ||||
std::string category; | std::string category; | ||||
bool active; | bool active; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | private: | ||||
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 = false; | 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; | ||||
bool m_log_threadnames = DEFAULT_LOGTHREADNAMES; | |||||
fs::path m_file_path; | 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); | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |