USB Device - Joystick/Mouse  1.0
log.h
Go to the documentation of this file.
1 #ifndef _LOG_H_
2 #define _LOG_H_
3 
4 #include "serial.h"
5 #include <stdarg.h>
6 
7 #define LOG_MSG_PRNT_DEF(type,name,x,...) CLog::instance()->logMsgDef(type, name, x, ##__VA_ARGS__ )
8 
9 #define LOG_MSG_SIZE (128)
10 #define MAX_LCD_LINES (24)
11 #define ABS_DIFF_LCD_LINE (1)
12 #define REL_DIFF_LCD_LINE (10)
13 #define REL_DIFF_LCD_COL (7)
14 
15 static const char *logName[] = {
16  "MAIN",
17  "USB",
18  "JOY",
19 };
20 
21 static const char *logType[] = {
22  "ERROR",
23  "INFO",
24  "WARNING",
25  "DEBUG",
26 };
27 
28 class CLog {
29  public:
31  MAIN = 0,
32  USB = 1,
33  JOY = 2,
34  };
35 
36  enum ELogType
37  {
38  ERROR = 0,
39  INFO = 1,
40  WARNING = 2,
41  DEBUG = 3,
42  };
43 
45 
46  static CLog* instance();
47  void init();
48  void logMsgDef(ELogType type, CLog::ELogNameIndex nameIndx, const char* msg, ...);
49  void logMsgWList(ELogType type, const char* name, const char* msg, va_list args);
50 
51  private:
52  CLog();
53  CLog(const CLog&);
54  static bool comInitialized;
55  static bool dispInitialized;
56  bool log2LCD;
57  int actLCDLine;
58  public:
59  static const char* monthStr[12];
60 };
61 
62 #endif //_LOG_H_
static CLog * instance()
Definition: log.c:12
void logMsgDef(ELogType type, CLog::ELogNameIndex nameIndx, const char *msg,...)
Definition: log.c:34
Definition: log.h:32
Definition: log.h:33
Definition: log.h:31
Definition: log.h:38
ELogNameIndex
Definition: log.h:30
Definition: log.h:41
static const char * monthStr[12]
Definition: log.h:59
ELogType
Definition: log.h:36
CRS232 com
COM do ktereho to bleju.
Definition: log.h:44
Definition: log.h:28
void init()
Definition: log.c:29
Definition: log.h:40
Definition: serial.h:6
Definition: log.h:39
void logMsgWList(ELogType type, const char *name, const char *msg, va_list args)
Definition: log.c:43