source: libcf/trunk/include/cf_log.h@ 12

Last change on this file since 12 was 12, checked in by cheese, 11 years ago

#1 implement logging module

File size: 1.1 KB
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
20typedef void * CF_Log_Ctx;
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26CF_EXPORT int
27CF_Log_Initialize (const int logPool);
28
29CF_EXPORT int
30CF_Log_Finalize (void);
31
32CF_EXPORT CF_Log_Ctx
33CF_Log_CreateCtx (const char * path,
34 const int memsize);
35
36CF_EXPORT int
37CF_Log_SetMultiThread (CF_Log_Ctx ctx);
38
39CF_EXPORT int
40CF_Log_UnsetMultiThread (CF_Log_Ctx ctx);
41
42CF_EXPORT int
43CF_Log_DestroyCtx (CF_Log_Ctx ctx);
44
45CF_EXPORT int
46CF_Log_Write (CF_Log_Ctx ctx,
47 const char * prefix,
48 const char * fmt, ...);
49
50CF_EXPORT int
51CF_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.