- Timestamp:
- Jul 21, 2009 12:20:17 PM (15 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/log.h
r2394 r2842 81 81 PJ_LOG_HAS_SPACE = 512, /**< Include two spaces before log [yes] */ 82 82 PJ_LOG_HAS_COLOR = 1024, /**< Colorize logs [yes on win32] */ 83 PJ_LOG_HAS_LEVEL_TEXT = 2048 /**< Include level text string [no] */ 83 PJ_LOG_HAS_LEVEL_TEXT = 2048, /**< Include level text string [no] */ 84 PJ_LOG_HAS_THREAD_ID = 4096 /**< Include thread identification [no] */ 84 85 }; 85 86 -
pjproject/trunk/pjlib/src/pj/log.c
r2394 r2842 34 34 static unsigned log_decor = PJ_LOG_HAS_TIME | PJ_LOG_HAS_MICRO_SEC | 35 35 PJ_LOG_HAS_SENDER | PJ_LOG_HAS_NEWLINE | 36 PJ_LOG_HAS_SPACE 36 PJ_LOG_HAS_SPACE 37 37 #if defined(PJ_WIN32) && PJ_WIN32!=0 38 38 | PJ_LOG_HAS_COLOR … … 221 221 } 222 222 } 223 if (log_decor & PJ_LOG_HAS_THREAD_ID) { 224 enum { THREAD_WIDTH = 12 }; 225 const char *thread_name = pj_thread_get_name(pj_thread_this()); 226 int thread_len = strlen(thread_name); 227 *pre++ = ' '; 228 if (thread_len <= THREAD_WIDTH) { 229 while (thread_len < THREAD_WIDTH) 230 *pre++ = ' ', ++thread_len; 231 while (*thread_name) 232 *pre++ = *thread_name++; 233 } else { 234 int i; 235 for (i=0; i<THREAD_WIDTH; ++i) 236 *pre++ = *thread_name++; 237 } 238 } 223 239 224 240 if (log_decor != 0 && log_decor != PJ_LOG_HAS_NEWLINE)
Note: See TracChangeset
for help on using the changeset viewer.