Changes between Version 1 and Version 4 of Ticket #1372


Ignore:
Timestamp:
Sep 18, 2011 11:30:51 PM (13 years ago)
Author:
bennylp
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1372 – Description

    v1 v4  
     1Two new features are introduced by this ticket: 
     2 
    13'''1. Indentation''' 
    24 
     
    2224Also two new macros to customize the behavior: PJ_LOG_INDENT_SIZE, and PJ_LOG_INDENT_CHAR. 
    2325 
     26Sample code: 
     27 
     28{{{ 
     29#include <pj/log.h> 
     30#define THIS_FILE  "sample.c" 
     31 
     32void inner() 
     33{ 
     34    PJ_LOG(4,(THIS_FILE, "We're in inner")); 
     35} 
     36 
     37void outer() 
     38{ 
     39    PJ_LOG(4,(THIS_FILE, "Calling inner")); 
     40    pj_log_push_indent(); 
     41    inner(); 
     42    pj_log_pop_indent(); 
     43} 
     44 
     45int main() 
     46{ 
     47    pj_log_set_decor(pj_log_get_decor() | PJ_LOG_HAS_INDENT); 
     48    outer(); 
     49    return 0; 
     50} 
     51 
     52}}} 
     53 
     54The sample code above will produce: 
     55{{{ 
     5621:13:35.787       sample.c  Calling inner 
     5721:13:35.787       sample.c  .We're in inner 
     58}}} 
     59 
     60 
    2461'''2. Thread Switch Indication''' 
    2562 
    26 An exclamation mark will be placed before the log message if the caller thread is different than the previous message.  
     63An exclamation mark will be placed before a log message if the caller thread is different than the caller thread of the previous message.  
    2764 
    2865Example: