Changeset 12 in libcf for trunk/include/cf_log.h


Ignore:
Timestamp:
01/31/13 14:40:55 (11 years ago)
Author:
cheese
Message:

#1 implement logging module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_log.h

    r11 r12  
    88
    99#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
    1016
    11 typedef enum {
    12     CF_LOG_WITHOUT_MT = 0,
    13     CF_LOG_WITH_MT
    14 } E_CF_LOG_MT, CF_LOG_MT;
     17#define CF_LOG_BUFFER_DEFAULT           -1
     18#define CF_LOG_BUFFER_NO                0
    1519
    1620typedef void *  CF_Log_Ctx;
     
    2125
    2226CF_EXPORT int
    23 CF_Log_Initialize       (void);
     27CF_Log_Initialize       (const int logPool);
    2428
    2529CF_EXPORT int
    2630CF_Log_Finalize         (void);
    2731
     32CF_EXPORT CF_Log_Ctx
     33CF_Log_CreateCtx        (const char * path,
     34                         const int  memsize);
     35
    2836CF_EXPORT int
    29 CF_Log_CreateCtx        (CF_Log_Ctx     ctx,
    30                          const char     * path,
    31                          const int      bufferLength,
    32                          CF_LOG_MT      isMT);
     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);
    3352
    3453#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.