Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (580 Bytes)

1
/**
2
 * @file Log.h
3
 *
4
 * @author Jason Knichel
5
 *
6
 */
7

    
8
#ifndef LOG_H
9
#define LOG_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(void);
27

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

    
32
private:
33
  struct tm get_current_time();
34

    
35
  FILE * log_file;
36
};
37

    
38
#endif