Changeset 108 in libcf


Ignore:
Timestamp:
05/31/13 15:49:49 (11 years ago)
Author:
cheese
Message:

#1 remove log-level. log id is used as log level instead.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_log.h

    r103 r108  
    1818    CF_LOG_DEFAULT_BUFFER   = -1,   /**< 기본 버퍼 크기 사용 */
    1919    CF_LOG_NO_BUFFER        = 0,    /**< 버퍼없이 파일에 바로 쓰기 */
    20     CF_LOG_NO_LEVEL         = -1,   /**< 로그 레벨 사용 안함 */
    2120} E_CF_LOG_OPTION, CF_LOG_OPTION;
    2221
     
    2625
    2726CF_EXPORT int
    28 CF_Log_Initialize       (const int poolSize,
    29                          const int level);
     27CF_Log_Initialize       (const int poolSize);
    3028
    3129CF_EXPORT int
  • trunk/src/cf_log.c

    r107 r108  
    4949    if (gLogArray.ctxPool[__mapid] == NULL) \
    5050        return CF_ERROR_LOG_NOT_MAPPED_ID
    51 
    52 #define CHECK_LOG_LEVEL(__mapid)                                        \
    53     if (gLogArray.level < mapid)    \
    54         return CF_OK
    5551
    5652#define LOCK_LOG_CTX(__ctx)             CF_Mutex_Lock (&__ctx->mutex)
     
    9389    CF_Log_Ctx  * ctxPool;
    9490    int         ctxSize;
    95     int         level;
    9691} S_CF_LOG_ARRAY, CF_LOG_ARRAY;
    9792
     
    526521 *
    527522 * @param poolSize  로그 풀 크기로, 로그 아이디 넘버의 최대 값
    528  * @param level     로그 레벨
    529  *
    530  * @see CF_LOG_NO_LEVEL
    531523 */
    532524int
    533 CF_Log_Initialize (const int poolSize,
    534                    const int level)
     525CF_Log_Initialize (const int poolSize)
    535526{
    536527    memset (&gLogArray, 0x00, sizeof (CF_LOG_ARRAY));
     
    543534            return CF_ERROR_LOG_INITIALIZE;
    544535        gLogArray.ctxSize = poolSize;
    545         gLogArray.level = (level == CF_LOG_NO_LEVEL) ? poolSize : level;
    546536    }
    547537
     
    591581    CF_Log_Ctx  ctx = NULL;
    592582
    593     CHECK_LOG_LEVEL (mapid);
    594 
    595583    result = CF_Log_CreateCtx (path, memsize, &ctx);
    596584    if (result < 0)
     
    614602CF_Log_Close (const int mapid)
    615603{
    616     CHECK_LOG_LEVEL (mapid);
    617 
    618604    return CF_Log_UnmapCtxID (mapid);
    619605}
     
    687673    va_list     valist;
    688674
    689     CHECK_LOG_LEVEL (mapid);
    690 
    691675    result = CF_Log_GetMappedCtx (mapid, &ctx);
    692676    if (result < 0)
  • trunk/test/log.c

    r105 r108  
    4646
    4747    /* initialize */
    48     if (CF_Log_Initialize (10, 2) < 0)
     48    if (CF_Log_Initialize (10) < 0)
    4949    {
    5050        fprintf (stderr, "failed to init. log\n");
  • trunk/test/socket.c

    r105 r108  
    107107
    108108    /*------------------------------------------------------------*/
    109     if (CF_Log_Initialize (1, CF_LOG_NO_LEVEL) < 0)
     109    if (CF_Log_Initialize (1) < 0)
    110110    {
    111111        fprintf (stderr, "failed to init. log\n");
Note: See TracChangeset for help on using the changeset viewer.