-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.h
42 lines (34 loc) · 1.08 KB
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef ZSL_LIB_LOG_H
#define ZSL_LIB_LOG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "Locker.h"
#include <stdarg.h>
#include <time.h>
struct _logger;
typedef struct _logger Logger;
typedef void (*Fatal)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*Error)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*Warn)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*Info)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*Debug)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*LogAll)(Logger* log,const char * filename, const int line, const char * funcname,char* msg,...);
typedef void (*Destroy)(Logger* log);
struct _logger{
Fatal fatal;
Error error;
Debug warn;
Info info;
Debug debug;
LogAll all;
Destroy destroy;
FILE* fp;
int logLevel;
Locker* lock;
};
#ifdef __cplusplus
}
#endif
#endif