Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / ColonetServer / includes / Logging.h @ 24

History | View | Annotate | Download (559 Bytes)

1 20 jknichel
//TODO: rename either the file or the class so they match
2 11 emarinel
/**
3
 *
4
 *  @author Jason Knichel
5
 *
6
 */
7
8
#ifndef LOGGING_H
9
#define LOGGING_H
10
11
#include <time.h>
12
#include <stdio.h>
13
14
#define LOG_TYPE_START_LOG  0
15
#define LOG_TYPE_CONNECT    1
16
#define LOG_TYPE_DISCONNECT 2
17
#define LOG_TYPE_ERROR      3
18
#define LOG_TYPE_MESSAGE    4
19
20
#define LOG_MAX_TYPE_LENGTH 25
21
#define LOG_MAX_TIME_LENGTH 64
22
23
class Log {
24
public:
25
  Log(char * fileName);
26
  ~Log();
27
28
  int logMessage(int type, char * message);
29
30
private:
31
  struct tm getCurrentTime();
32
33
  FILE * logFile;
34
35
};
36
37
38
#endif