Garmin Fleet Management Controller  2.19.0
Logger.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * Logger.h
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef Logger_H
11 #define Logger_H
12 
13 class Logger;
14 
15 #include <fstream>
16 
17 #include "ApplicationLayer.h"
18 #include "Packet.h"
19 
20 //----------------------------------------------------------------------
23 //----------------------------------------------------------------------
24 class Logger
25 {
26 public:
27  static void clearLog();
28  static void closeLog();
29  static bool isLogOpen();
30  static void logRawData
31  (
32  Packet * aPacket,
33  bool aIsTx = true
34  );
35 
36 
37  static const char * LOG_FILE;
38 protected:
39 
40 private:
42  Logger();
43 
45  virtual ~Logger();
46 
49  static SYSTEMTIME mLogStartTime;
50 
52  static std::wofstream mLogFile;
53 };
54 
55 #endif
Log writer.
Definition: Logger.h:24
virtual ~Logger()
Destructor.
static void clearLog()
Empties the packet log.
Definition: Logger.cpp:83
static const char * LOG_FILE
The log file that this Logger writes to.
Definition: Logger.h:37
Logger()
Construct a new Logger.
static SYSTEMTIME mLogStartTime
Time when the packet log was started/cleared; used to compute offsets.
Definition: Logger.h:49
Abstract base class for a packet of data.
Definition: Packet.h:18
static std::wofstream mLogFile
File stream that the packet log is written to.
Definition: Logger.h:52
static void logRawData(Packet *aPacket, bool aIsTx=true)
Logs the raw data of the packet passed in to a file.
Definition: Logger.cpp:31
static void closeLog()
Close the log file.
Definition: Logger.cpp:102
static bool isLogOpen()
Returns true if the log file is open.
Definition: Logger.cpp:111