Changeset 14 in libcf for trunk/src/cf_log.c
- Timestamp:
- 01/31/13 22:55:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_log.c
r13 r14 2 2 * cf_log.c 3 3 */ 4 #ifdef _WIN32 5 # define _USE_32BIT_TIME_T 6 #endif 7 4 8 #include "cf_log.h" 5 9 #include "cf_file.h" … … 14 18 15 19 #ifdef _WIN32 20 # define snprintf _snprintf 16 21 # include <Windows.h> 17 22 #else // #ifdef _WIN32 … … 24 29 25 30 #define LOCK_LOG_CTX(__ctx) \ 26 if (CF_Mutex_Lock (&__ctx->mutex) < 0) \ 27 return CF_ERROR_LOG_LOCK_CTX 31 CF_Mutex_Lock (&__ctx->mutex) 28 32 29 33 #define UNLOCK_LOG_CTX(__ctx) \ 30 if (CF_Mutex_Unlock (&__ctx->mutex) < 0) \ 31 return CF_ERROR_LOG_UNLOCK_CTX 34 CF_Mutex_Unlock (&__ctx->mutex) 32 35 33 36 #define CF_LOG_BUFFER_DEFAULT_SIZE 128 * 1024 … … 146 149 CF_Log_Local_GetTime (&dt); 147 150 148 sprintf (buffer, "%02d-%02d-%02d %02d:%02d:%02d.%03d", 149 dt.year, dt.month, dt.day, 150 dt.hour, dt.min, dt.sec, dt.usec); 151 152 153 snprintf (buffer, strlen ("0000-00-00 00:00:00.000"), 154 "%02d-%02d-%02d %02d:%02d:%02d.%03d", 155 dt.year, dt.month, dt.day, 156 dt.hour, dt.min, dt.sec, dt.usec); 151 157 152 158 return CF_OK; … … 287 293 if (context->buffer != NULL) 288 294 { 289 /* FIXME : write residual data in buffer */ 290 295 CF_Log_Flush (ctx); 291 296 free (context->buffer); 292 297 context->buffer = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.