root / trunk / code / projects / colonet / ColonetServer / includes / Log.h @ 426
History | View | Annotate | Download (580 Bytes)
1 | 57 | jknichel | /**
|
---|---|---|---|
2 | 141 | jknichel | * @file Log.h
|
3 | 57 | jknichel | *
|
4 | 141 | jknichel | * @author Jason Knichel
|
5 | 57 | jknichel | *
|
6 | */
|
||
7 | |||
8 | 141 | jknichel | #ifndef LOG_H
|
9 | #define LOG_H
|
||
10 | 57 | jknichel | |
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 | 426 | emarinel | ~Log(void);
|
27 | 57 | jknichel | |
28 | 132 | jknichel | int log_string(int type, char * message); |
29 | int log_error(char * message); |
||
30 | int log_message(char * message); |
||
31 | 57 | jknichel | |
32 | private:
|
||
33 | 132 | jknichel | struct tm get_current_time();
|
34 | 57 | jknichel | |
35 | 141 | jknichel | FILE * log_file; |
36 | 57 | jknichel | }; |
37 | |||
38 | #endif |