Changeset 108 in libcf
- Timestamp:
- 05/31/13 15:49:49 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/cf_log.h
r103 r108 18 18 CF_LOG_DEFAULT_BUFFER = -1, /**< 기본 버퍼 크기 사용 */ 19 19 CF_LOG_NO_BUFFER = 0, /**< 버퍼없이 파일에 바로 쓰기 */ 20 CF_LOG_NO_LEVEL = -1, /**< 로그 레벨 사용 안함 */21 20 } E_CF_LOG_OPTION, CF_LOG_OPTION; 22 21 … … 26 25 27 26 CF_EXPORT int 28 CF_Log_Initialize (const int poolSize, 29 const int level); 27 CF_Log_Initialize (const int poolSize); 30 28 31 29 CF_EXPORT int -
trunk/src/cf_log.c
r107 r108 49 49 if (gLogArray.ctxPool[__mapid] == NULL) \ 50 50 return CF_ERROR_LOG_NOT_MAPPED_ID 51 52 #define CHECK_LOG_LEVEL(__mapid) \53 if (gLogArray.level < mapid) \54 return CF_OK55 51 56 52 #define LOCK_LOG_CTX(__ctx) CF_Mutex_Lock (&__ctx->mutex) … … 93 89 CF_Log_Ctx * ctxPool; 94 90 int ctxSize; 95 int level;96 91 } S_CF_LOG_ARRAY, CF_LOG_ARRAY; 97 92 … … 526 521 * 527 522 * @param poolSize 로그 풀 크기로, 로그 아이디 넘버의 최대 값 528 * @param level 로그 레벨529 *530 * @see CF_LOG_NO_LEVEL531 523 */ 532 524 int 533 CF_Log_Initialize (const int poolSize, 534 const int level) 525 CF_Log_Initialize (const int poolSize) 535 526 { 536 527 memset (&gLogArray, 0x00, sizeof (CF_LOG_ARRAY)); … … 543 534 return CF_ERROR_LOG_INITIALIZE; 544 535 gLogArray.ctxSize = poolSize; 545 gLogArray.level = (level == CF_LOG_NO_LEVEL) ? poolSize : level;546 536 } 547 537 … … 591 581 CF_Log_Ctx ctx = NULL; 592 582 593 CHECK_LOG_LEVEL (mapid);594 595 583 result = CF_Log_CreateCtx (path, memsize, &ctx); 596 584 if (result < 0) … … 614 602 CF_Log_Close (const int mapid) 615 603 { 616 CHECK_LOG_LEVEL (mapid);617 618 604 return CF_Log_UnmapCtxID (mapid); 619 605 } … … 687 673 va_list valist; 688 674 689 CHECK_LOG_LEVEL (mapid);690 691 675 result = CF_Log_GetMappedCtx (mapid, &ctx); 692 676 if (result < 0) -
trunk/test/log.c
r105 r108 46 46 47 47 /* initialize */ 48 if (CF_Log_Initialize (10 , 2) < 0)48 if (CF_Log_Initialize (10) < 0) 49 49 { 50 50 fprintf (stderr, "failed to init. log\n"); -
trunk/test/socket.c
r105 r108 107 107 108 108 /*------------------------------------------------------------*/ 109 if (CF_Log_Initialize (1 , CF_LOG_NO_LEVEL) < 0)109 if (CF_Log_Initialize (1) < 0) 110 110 { 111 111 fprintf (stderr, "failed to init. log\n");
Note:
See TracChangeset
for help on using the changeset viewer.