Changes between Version 1 and Version 4 of Ticket #1372
- Timestamp:
- Sep 18, 2011 11:30:51 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1372 – Description
v1 v4 1 Two new features are introduced by this ticket: 2 1 3 '''1. Indentation''' 2 4 … … 22 24 Also two new macros to customize the behavior: PJ_LOG_INDENT_SIZE, and PJ_LOG_INDENT_CHAR. 23 25 26 Sample code: 27 28 {{{ 29 #include <pj/log.h> 30 #define THIS_FILE "sample.c" 31 32 void inner() 33 { 34 PJ_LOG(4,(THIS_FILE, "We're in inner")); 35 } 36 37 void outer() 38 { 39 PJ_LOG(4,(THIS_FILE, "Calling inner")); 40 pj_log_push_indent(); 41 inner(); 42 pj_log_pop_indent(); 43 } 44 45 int main() 46 { 47 pj_log_set_decor(pj_log_get_decor() | PJ_LOG_HAS_INDENT); 48 outer(); 49 return 0; 50 } 51 52 }}} 53 54 The sample code above will produce: 55 {{{ 56 21:13:35.787 sample.c Calling inner 57 21:13:35.787 sample.c .We're in inner 58 }}} 59 60 24 61 '''2. Thread Switch Indication''' 25 62 26 An exclamation mark will be placed before the log message if the caller thread is different thanthe previous message.63 An exclamation mark will be placed before a log message if the caller thread is different than the caller thread of the previous message. 27 64 28 65 Example: