Changeset 2842 for pjproject/trunk/pjlib/src/pj/log.c
- Timestamp:
- Jul 21, 2009 12:20:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.