OpenCPN Partial API docs
|
Logging interface. More...
#include <logger.h>
Public Member Functions | |
OcpnLog (const char *path) | |
Create logger appending to given filename. More... | |
void | Flush () override |
void | DoLogRecord (wxLogLevel level, const wxString &msg, const wxLogRecordInfo &info) override |
Static Public Member Functions | |
static wxLogLevel | str2level (const char *string) |
static std::string | level2str (wxLogLevel level) |
Static Public Attributes | |
static const wxLogLevel | LOG_BADLEVEL = wxLOG_Max + 1 |
Protected Attributes | |
std::ofstream | log |
Logging interface.
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(). Customized logger class appending to a file providing:
OcpnLog::OcpnLog | ( | const char * | path | ) |
Create logger appending to given filename.
Definition at line 82 of file logger.cpp.
|
virtual |
Definition at line 86 of file logger.cpp.
|
override |
Definition at line 93 of file logger.cpp.
|
override |
Definition at line 88 of file logger.cpp.
|
static |
Definition at line 67 of file logger.cpp.
|
static |
Definition at line 72 of file logger.cpp.
|
static |