Line | |
---|
1 | /*
|
---|
2 | * cf_log.h
|
---|
3 | */
|
---|
4 | #ifndef __CF_LOG_H__
|
---|
5 | #define __CF_LOG_H__
|
---|
6 |
|
---|
7 | #include "cf_base.h"
|
---|
8 |
|
---|
9 | #define CF_ERROR_LOG_INITIALIZE CF_ERROR_LOG - 1
|
---|
10 | #define CF_ERROR_LOG_INVALID_CTX CF_ERROR_LOG - 2
|
---|
11 | #define CF_ERROR_LOG_SET_MULTITHREAD CF_ERROR_LOG - 3
|
---|
12 | #define CF_ERROR_LOG_UNSET_MULTITHREAD CF_ERROR_LOG - 4
|
---|
13 | #define CF_ERROR_LOG_LOCK_CTX CF_ERROR_LOG - 5
|
---|
14 | #define CF_ERROR_LOG_UNLOCK_CTX CF_ERROR_LOG - 6
|
---|
15 | #define CF_ERROR_LOG_FLUSH CF_ERROR_LOG - 7
|
---|
16 |
|
---|
17 | #define CF_LOG_BUFFER_DEFAULT -1
|
---|
18 | #define CF_LOG_BUFFER_NO 0
|
---|
19 |
|
---|
20 | typedef void * CF_Log_Ctx;
|
---|
21 |
|
---|
22 | #ifdef __cplusplus
|
---|
23 | extern "C" {
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | CF_EXPORT int
|
---|
27 | CF_Log_Initialize (const int logPool);
|
---|
28 |
|
---|
29 | CF_EXPORT int
|
---|
30 | CF_Log_Finalize (void);
|
---|
31 |
|
---|
32 | CF_EXPORT CF_Log_Ctx
|
---|
33 | CF_Log_CreateCtx (const char * path,
|
---|
34 | const int memsize);
|
---|
35 |
|
---|
36 | CF_EXPORT int
|
---|
37 | CF_Log_SetMultiThread (CF_Log_Ctx ctx);
|
---|
38 |
|
---|
39 | CF_EXPORT int
|
---|
40 | CF_Log_UnsetMultiThread (CF_Log_Ctx ctx);
|
---|
41 |
|
---|
42 | CF_EXPORT int
|
---|
43 | CF_Log_DestroyCtx (CF_Log_Ctx ctx);
|
---|
44 |
|
---|
45 | CF_EXPORT int
|
---|
46 | CF_Log_Write (CF_Log_Ctx ctx,
|
---|
47 | const char * prefix,
|
---|
48 | const char * fmt, ...);
|
---|
49 |
|
---|
50 | CF_EXPORT int
|
---|
51 | CF_Log_Flush (CF_Log_Ctx ctx);
|
---|
52 |
|
---|
53 | #ifdef __cplusplus
|
---|
54 | }
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #endif // #ifndef __CF_LOG_H__
|
---|
Note:
See
TracBrowser
for help on using the repository browser.