Changeset 40 in libcf for trunk/include/cf_log.h
- Timestamp:
- 02/06/13 16:11:24 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/cf_log.h
r38 r40 11 11 #include "cf_base.h" 12 12 13 #define CF_ERROR_LOG_INITIALIZE CF_ERROR_LOG - 114 #define CF_ERROR_LOG_INVALID_CTX CF_ERROR_LOG - 215 #define CF_ERROR_LOG_SET_MULTITHREAD CF_ERROR_LOG - 316 #define CF_ERROR_LOG_UNSET_MULTITHREAD CF_ERROR_LOG - 417 #define CF_ERROR_LOG_LOCK_CTX CF_ERROR_LOG - 518 #define CF_ERROR_LOG_UNLOCK_CTX CF_ERROR_LOG - 619 #define CF_ERROR_LOG_FLUSH CF_ERROR_LOG - 720 #define CF_ERROR_LOG_INVALID_MAPID CF_ERROR_LOG - 821 #define CF_ERROR_LOG_NOT_MAPPED_ID CF_ERROR_LOG - 922 #define CF_ERROR_LOG_ALREADY_MAPPED_ID CF_ERROR_LOG - 1023 #define CF_ERROR_LOG_NOT_INITIALIZE CF_ERROR_LOG - 1124 25 13 /** 26 14 * 로그의 버퍼 크기를 기본 값으로 설정 27 15 * 28 * @see CF_Log_ CreateCtx, CF_LOG_OPEN16 * @see CF_Log_Open 29 17 */ 30 18 #define CF_LOG_BUFFER_DEFAULT -1 … … 33 21 * 로그 기록 시 버퍼를 사용하지 않고 즉시 기록 34 22 * 35 * @see CF_Log_ CreateCtx, CF_LOG_OPEN, CF_Log_Initialize23 * @see CF_Log_Open 36 24 */ 37 25 #define CF_LOG_BUFFER_NO 0 38 39 /**40 * 로그에 아이디 넘버를 부여하여 생성 <br />41 * 로그 기록 시, 아이디 넘버를 사용하면 해당 로그로 기록할 수 있음42 *43 * @param __id 부여할 아이디 넘버44 * @param __file 로그 파일 경로45 * @param __memsize 로그 버퍼 크기46 *47 * @see CF_Log_MapCtxID48 */49 #define CF_LOG_OPEN(__id,__file,__memsize) \50 CF_Log_MapCtxID (__id, CF_Log_CreateCtx (__file, __memsize))51 52 /**53 * 아이디 넘버에 해당하는 로그에 쓰기54 *55 * @param __id 로그의 아이디 넘버56 * @param __pf 로그의 프리픽스 문자열57 * @param __fmt 포맷 스트링58 * @param ... 가변 인자59 *60 * @see CF_Log_GetMappedCtx61 */62 #define CF_LOG_WRITE(__id,__pf,__fmt,...) \63 CF_Log_Write (CF_Log_GetMappedCtx (__id),__pf,__fmt,##__VA_ARGS__)64 65 /**66 * 아이디 넘버에 해당하는 로그를 닫고 해제67 *68 * @param __id 로그의 아이디 넘버69 *70 * @see CF_Log_UnmapCtxID71 */72 #define CF_LOG_CLOSE(__id) CF_Log_UnmapCtxID (__id)73 74 /** 로그 컨텍스트 */75 typedef void * CF_Log_Ctx;76 26 77 27 #ifdef __cplusplus … … 85 35 CF_Log_Finalize (void); 86 36 87 CF_EXPORT CF_Log_Ctx 88 CF_Log_CreateCtx (const char * path, 37 CF_EXPORT int 38 CF_Log_Open (const int mapid, 39 const char * path, 89 40 const int memsize); 90 41 91 42 CF_EXPORT int 92 CF_Log_ DestroyCtx (CF_Log_Ctx ctx);43 CF_Log_Close (const int mapid); 93 44 94 45 CF_EXPORT int 95 CF_Log_SetMultiThread (CF_Log_Ctx ctx); 46 CF_Log_SetMT (const int mapid, 47 const CF_BOOL flag); 96 48 97 49 CF_EXPORT int 98 CF_Log_UnsetMultiThread (CF_Log_Ctx ctx); 99 100 CF_EXPORT int 101 CF_Log_Write (CF_Log_Ctx ctx, 50 CF_Log_Write (const int mapid, 102 51 const char * prefix, 103 52 const char * fmt, ...); 104 53 105 54 CF_EXPORT int 106 CF_Log_Flush (CF_Log_Ctx ctx); 107 108 CF_EXPORT int 109 CF_Log_MapCtxID (const int mapid, 110 const CF_Log_Ctx ctx); 111 112 CF_EXPORT int 113 CF_Log_UnmapCtxID (const int mapid); 114 115 CF_EXPORT CF_Log_Ctx 116 CF_Log_GetMappedCtx (const int mapid); 55 CF_Log_Flush (const int mapid); 117 56 118 57 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.