Changeset 2181


Ignore:
Timestamp:
Jul 28, 2008 9:15:04 PM (16 years ago)
Author:
bennylp
Message:

Added PJ_LOG_HAS_LEVEL_TEXT logging flag to display the log verbosity level (thanks Ondrej Sterbak for the patch)

Location:
pjproject/trunk/pjlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/log.h

    r2159 r2181  
    7979    PJ_LOG_HAS_CR         =  256, /**< Include carriage return [no]           */ 
    8080    PJ_LOG_HAS_SPACE      =  512, /**< Include two spaces before log [yes]    */ 
    81     PJ_LOG_HAS_COLOR      = 1024  /**< Colorize logs [yes on win32]           */ 
     81    PJ_LOG_HAS_COLOR      = 1024, /**< Colorize logs [yes on win32]           */ 
     82    PJ_LOG_HAS_LEVEL_TEXT = 2048  /**< Include level text string [no]         */ 
    8283}; 
    8384 
  • pjproject/trunk/pjlib/src/pj/log.c

    r2159 r2181  
    169169 
    170170    pre = log_buffer; 
     171    if (log_decor & PJ_LOG_HAS_LEVEL_TEXT) { 
     172        static const char *ltexts[] = { "FATAL:", "ERROR:", " WARN:",  
     173                              " INFO:", "DEBUG:", "TRACE:", "DETRC:"}; 
     174        pj_ansi_strcpy(pre, ltexts[level]); 
     175        pre += 6; 
     176    } 
    171177    if (log_decor & PJ_LOG_HAS_DAY_NAME) { 
    172178        static const char *wdays[] = { "Sun", "Mon", "Tue", "Wed", 
Note: See TracChangeset for help on using the changeset viewer.