Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / ColonetServer / includes / Log.h @ 132

History | View | Annotate | Download (569 Bytes)

1
/**
2
 *
3
 *  @author Jason Knichel
4
 *
5
 */
6

    
7
#ifndef LOGGING_H
8
#define LOGGING_H
9

    
10
#include <time.h>
11
#include <stdio.h>
12

    
13
#define LOG_TYPE_START_LOG  0
14
#define LOG_TYPE_CONNECT    1
15
#define LOG_TYPE_DISCONNECT 2
16
#define LOG_TYPE_ERROR      3
17
#define LOG_TYPE_MESSAGE    4
18

    
19
#define LOG_MAX_TYPE_LENGTH 25
20
#define LOG_MAX_TIME_LENGTH 64
21

    
22
class Log {
23
public:
24
  Log(char * fileName);
25
  ~Log();
26

    
27
  int log_string(int type, char * message);
28
  int log_error(char * message);
29
  int log_message(char * message);
30

    
31
private:
32
  struct tm get_current_time();
33

    
34
  FILE * logFile;
35
};
36

    
37
#endif