OpenCPN Partial API docs
Loading...
Searching...
No Matches
OcpnLog Class Reference

Customized logger class appending to a file providing: More...

#include <logger.h>

Inheritance diagram for OcpnLog:

Public Member Functions

 OcpnLog (const char *path)
 Create logger appending to given filename.
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

Detailed Description

Customized logger class appending to a file providing:

  • Millisecond timestamps
  • Consistent tagging WARNING, ERROR, MESSAGE etc.
  • Filename:line info.

Definition at line 87 of file logger.h.

Constructor & Destructor Documentation

◆ OcpnLog()

OcpnLog::OcpnLog ( const char * path)

Create logger appending to given filename.

Definition at line 82 of file logger.cpp.

◆ ~OcpnLog()

OcpnLog::~OcpnLog ( )
virtual

Definition at line 86 of file logger.cpp.

Member Function Documentation

◆ DoLogRecord()

void OcpnLog::DoLogRecord ( wxLogLevel level,
const wxString & msg,
const wxLogRecordInfo & info )
override

Definition at line 93 of file logger.cpp.

◆ Flush()

void OcpnLog::Flush ( )
override

Definition at line 88 of file logger.cpp.

◆ level2str()

std::string OcpnLog::level2str ( wxLogLevel level)
static

Definition at line 67 of file logger.cpp.

◆ str2level()

wxLogLevel OcpnLog::str2level ( const char * string)
static

Definition at line 72 of file logger.cpp.

Member Data Documentation

◆ log

std::ofstream OcpnLog::log
protected

Definition at line 105 of file logger.h.

◆ LOG_BADLEVEL

const wxLogLevel OcpnLog::LOG_BADLEVEL = wxLOG_Max + 1
static

Definition at line 89 of file logger.h.


The documentation for this class was generated from the following files:
  • /home/runner/work/main/main/opencpn/model/include/model/logger.h
  • /home/runner/work/main/main/opencpn/model/src/logger.cpp