/* * cf_log.h */ #ifndef __CF_LOG_H__ #define __CF_LOG_H__ #include "cf_base.h" #define CF_ERROR_LOG_INITIALIZE CF_ERROR_LOG - 1 #define CF_ERROR_LOG_INVALID_CTX CF_ERROR_LOG - 2 #define CF_ERROR_LOG_SET_MULTITHREAD CF_ERROR_LOG - 3 #define CF_ERROR_LOG_UNSET_MULTITHREAD CF_ERROR_LOG - 4 #define CF_ERROR_LOG_LOCK_CTX CF_ERROR_LOG - 5 #define CF_ERROR_LOG_UNLOCK_CTX CF_ERROR_LOG - 6 #define CF_ERROR_LOG_FLUSH CF_ERROR_LOG - 7 #define CF_LOG_BUFFER_DEFAULT -1 #define CF_LOG_BUFFER_NO 0 typedef void * CF_Log_Ctx; #ifdef __cplusplus extern "C" { #endif CF_EXPORT int CF_Log_Initialize (const int logPool); CF_EXPORT int CF_Log_Finalize (void); CF_EXPORT CF_Log_Ctx CF_Log_CreateCtx (const char * path, const int memsize); CF_EXPORT int CF_Log_SetMultiThread (CF_Log_Ctx ctx); CF_EXPORT int CF_Log_UnsetMultiThread (CF_Log_Ctx ctx); CF_EXPORT int CF_Log_DestroyCtx (CF_Log_Ctx ctx); CF_EXPORT int CF_Log_Write (CF_Log_Ctx ctx, const char * prefix, const char * fmt, ...); CF_EXPORT int CF_Log_Flush (CF_Log_Ctx ctx); #ifdef __cplusplus } #endif #endif // #ifndef __CF_LOG_H__