64 static const wxLogLevel LOG_BADLEVEL;
71 void Flush()
override;
73 void DoLogRecord(wxLogLevel level,
const wxString& msg,
74 const wxLogRecordInfo& info)
override;
76 static wxLogLevel str2level(
const char*
string);
77 static std::string level2str(wxLogLevel level);
90 void logRecord(wxLogLevel level,
const char* msg,
const wxLogRecordInfo info);
92 std::ostream& get(wxLogLevel level,
const char* path,
int line);
94 static void logMessage(wxLogLevel level,
const char* path,
int line,
95 const char* fmt, ...);
103 #define DO_LOG_MESSAGE(level, fmt, ...) \
105 if (level <= wxLog::GetLogLevel()) { \
106 Logger::logMessage(level, __FILE__, __LINE__, fmt, ##__VA_ARGS__); \
110 #define _LOG(level) \
111 if (level > wxLog::GetLogLevel()) \
114 Logger().get(level, __FILE__, __LINE__)
116 #define TRACE_LOG _LOG(wxLOG_Trace)
117 #define DEBUG_LOG _LOG(wxLOG_Debug)
118 #define INFO_LOG _LOG(wxLOG_Info)
119 #define MESSAGE_LOG _LOG(wxLOG_Message)
120 #define WARNING_LOG _LOG(wxLOG_Warning)
121 #define ERROR_LOG _LOG(wxLOG_Error)
123 #define LOG_TRACE(fmt, ...) DO_LOG_MESSAGE(wxLOG_Trace, fmt, ##__VA_ARGS__);
124 #define LOG_DEBUG(fmt, ...) DO_LOG_MESSAGE(wxLOG_Debug, fmt, ##__VA_ARGS__);
125 #define LOG_INFO(fmt, ...) DO_LOG_MESSAGE(wxLOG_Info, fmt, ##__VA_ARGS__);
126 #define LOG_MESSAGE(fmt, ...) DO_LOG_MESSAGE(wxLOG_Message, fmt, ##__VA_ARGS__);
127 #define LOG_WARNING(fmt, ...) DO_LOG_MESSAGE(wxLOG_Warning, fmt, ##__VA_ARGS__);
128 #define LOG_ERROR(fmt, ...) DO_LOG_MESSAGE(wxLOG_Error, fmt, ##__VA_ARGS__);
Transient logger class, instantiated/used by the LOG macros.
void logRecord(wxLogLevel level, const char *msg, const wxLogRecordInfo info)
DoLogRecord public wrapper.
OcpnLog(const char *path)
Create logger appending to given filename.