OpenCPN Partial API docs
|
Enhanced logging interface on top of wx/log.h. More...
#include <chrono>
#include <fstream>
#include <ostream>
#include <sstream>
#include <string>
#include <wx/log.h>
Go to the source code of this file.
Classes | |
class | OcpnLog |
Customized logger class appending to a file providing: More... | |
class | Logger |
Transient logger class, instantiated/used by the LOG macros. More... | |
class | CountedLogFilter |
Filter logging every nth message. More... | |
class | TimedLogFilter |
Filter logging repeated message with specified interval. More... | |
Macros | |
#define | DO_LOG_MESSAGE(level, fmt, ...) |
#define | _LOG(level) |
#define | TRACE_LOG _LOG(wxLOG_Trace) |
#define | DEBUG_LOG _LOG(wxLOG_Debug) |
#define | INFO_LOG _LOG(wxLOG_Info) |
#define | MESSAGE_LOG _LOG(wxLOG_Message) |
#define | WARNING_LOG _LOG(wxLOG_Warning) |
#define | ERROR_LOG _LOG(wxLOG_Error) |
#define | LOG_TRACE(fmt, ...) DO_LOG_MESSAGE(wxLOG_Trace, fmt, ##__VA_ARGS__); |
#define | LOG_DEBUG(fmt, ...) DO_LOG_MESSAGE(wxLOG_Debug, fmt, ##__VA_ARGS__); |
#define | LOG_INFO(fmt, ...) DO_LOG_MESSAGE(wxLOG_Info, fmt, ##__VA_ARGS__); |
#define | LOG_MESSAGE(fmt, ...) DO_LOG_MESSAGE(wxLOG_Message, fmt, ##__VA_ARGS__); |
#define | LOG_WARNING(fmt, ...) DO_LOG_MESSAGE(wxLOG_Warning, fmt, ##__VA_ARGS__); |
#define | LOG_ERROR(fmt, ...) DO_LOG_MESSAGE(wxLOG_Error, fmt, ##__VA_ARGS__); |
Enhanced logging interface on top of wx/log.h.
The OcpnLog acts as the active wxLog target: it formats and prints log messages, overriding the default setup.
The Logger acts as a frontend to the wxLog logging providing C-style macros used like
LOG_INFO("Broken: %s", why);
Here is also C++ ostream log macros used like
INFO_LOG << "Broken: " << why;
These macros are very fast when logging is disabled for actual level, faster then the original wxLogMessage() and friends. They do not respect wxLog's component levels and trace masks, logging anything with a level <= wxLog::GetLogLevel().
Definition in file logger.h.
#define _LOG | ( | level | ) |
#define DO_LOG_MESSAGE | ( | level, | |
fmt, | |||
... | |||
) |
#define LOG_DEBUG | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Debug, fmt, ##__VA_ARGS__); |
#define LOG_ERROR | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Error, fmt, ##__VA_ARGS__); |
#define LOG_INFO | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Info, fmt, ##__VA_ARGS__); |
#define LOG_MESSAGE | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Message, fmt, ##__VA_ARGS__); |
#define LOG_TRACE | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Trace, fmt, ##__VA_ARGS__); |
#define LOG_WARNING | ( | fmt, | |
... | |||
) | DO_LOG_MESSAGE(wxLOG_Warning, fmt, ##__VA_ARGS__); |