Changeset View
Changeset View
Standalone View
Standalone View
src/logging.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | enum LogFlags : uint32_t { | ||||
VALIDATION = (1 << 21), | VALIDATION = (1 << 21), | ||||
ALL = ~uint32_t(0), | ALL = ~uint32_t(0), | ||||
}; | }; | ||||
class Logger { | class Logger { | ||||
private: | private: | ||||
// Can not use Mutex from sync.h because in debug mode it would cause a | // Can not use Mutex from sync.h because in debug mode it would cause a | ||||
// deadlock when a potential deadlock was detected | // deadlock when a potential deadlock was detected | ||||
mutable std::mutex m_cs; | mutable StdMutex m_cs; | ||||
FILE *m_fileout GUARDED_BY(m_cs) = nullptr; | FILE *m_fileout GUARDED_BY(m_cs) = nullptr; | ||||
std::list<std::string> m_msgs_before_open GUARDED_BY(m_cs); | std::list<std::string> m_msgs_before_open GUARDED_BY(m_cs); | ||||
//! Buffer messages before logging can be started. | //! Buffer messages before logging can be started. | ||||
bool m_buffering GUARDED_BY(m_cs) = true; | bool m_buffering GUARDED_BY(m_cs) = true; | ||||
/** | /** | ||||
* m_started_new_line is a state variable that will suppress printing of the | * m_started_new_line is a state variable that will suppress printing of the | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |