Garmin Fleet Management Controller
2.19.0
|
Log writer. More...
#include <Logger.h>
Static Public Member Functions | |
static void | clearLog () |
Empties the packet log. More... | |
static void | closeLog () |
Close the log file. More... | |
static bool | isLogOpen () |
Returns true if the log file is open. More... | |
static void | logRawData (Packet *aPacket, bool aIsTx=true) |
Logs the raw data of the packet passed in to a file. More... | |
Static Public Attributes | |
static const char * | LOG_FILE = "fmi_pc_app.log" |
The log file that this Logger writes to. More... | |
Private Member Functions | |
Logger () | |
Construct a new Logger. More... | |
virtual | ~Logger () |
Destructor. More... | |
Static Private Attributes | |
static std::wofstream | mLogFile |
File stream that the packet log is written to. More... | |
static SYSTEMTIME | mLogStartTime |
Time when the packet log was started/cleared; used to compute offsets. More... | |
|
private |
Construct a new Logger.
|
privatevirtual |
Destructor.
|
static |
Empties the packet log.
Closes and reopens the log file (removing any existing data), writes a start time entry with the current time, and sends a notification message that the log has changed.
Definition at line 83 of file Logger.cpp.
References EVENT_LOG_PACKET, LOG_FILE, mLogFile, mLogStartTime, and Event::post().
Referenced by SerialPort::initSerialPort(), TcpIpPort::initTcpPort(), CLogViewerDlg::OnBnClickedClearLog(), and CFmiPcAppDlg::OnFileClearPacketLog().
|
static |
Close the log file.
Definition at line 102 of file Logger.cpp.
References mLogFile.
Referenced by CFmiApplication::~CFmiApplication().
|
static |
Returns true if the log file is open.
Definition at line 111 of file Logger.cpp.
References mLogFile.
Referenced by SerialPort::initSerialPort(), and TcpIpPort::initTcpPort().
|
static |
Logs the raw data of the packet passed in to a file.
aPacket | The packet to log |
aIsTx | If true, this packet was transmitted (if false, this packet was received) |
Definition at line 31 of file Logger.cpp.
References EVENT_LOG_PACKET, Packet::getRawBytes(), Packet::getRawSize(), max_uint_val, mLogStartTime, and Event::post().
Referenced by GarminLinkLayer::getPacketFromFifo(), and GarminLinkLayer::tx().
|
static |
The log file that this Logger writes to.
Definition at line 37 of file Logger.h.
Referenced by clearLog(), CLogViewerDlg::OnBnClickedClearLog(), CLogViewerDlg::OnBnClickedViewCurrent(), CLogViewerDlg::OnInitDialog(), and CLogViewerDlg::resetView().
|
staticprivate |
File stream that the packet log is written to.
Definition at line 52 of file Logger.h.
Referenced by clearLog(), closeLog(), and isLogOpen().
|
staticprivate |
Time when the packet log was started/cleared; used to compute offsets.
Definition at line 49 of file Logger.h.
Referenced by clearLog(), and logRawData().