Changeset 2161


Ignore:
Timestamp:
Jul 19, 2008 8:53:49 PM (16 years ago)
Author:
bennylp
Message:

Added pjsua option to set the logging color scheme for terminal with light background (thanks Ondrej Sterbak)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r2159 r2161  
    161161    puts  ("  --color             Use colorful logging (default yes on Win32)"); 
    162162    puts  ("  --no-color          Disable colorful logging"); 
     163    puts  ("  --light-bg          Use dark colors for light background (default is dark bg)"); 
    163164 
    164165    puts  (""); 
     
    446447    int option_index; 
    447448    enum { OPT_CONFIG_FILE=127, OPT_LOG_FILE, OPT_LOG_LEVEL, OPT_APP_LOG_LEVEL,  
    448            OPT_COLOR, OPT_NO_COLOR, 
     449           OPT_COLOR, OPT_NO_COLOR, OPT_LIGHT_BG, 
    449450           OPT_HELP, OPT_VERSION, OPT_NULL_AUDIO, OPT_SND_AUTO_CLOSE, 
    450451           OPT_LOCAL_PORT, OPT_IP_ADDR, OPT_PROXY, OPT_OUTBOUND_PROXY,  
     
    456457           OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, 
    457458           OPT_USE_ICE, OPT_USE_SRTP, OPT_SRTP_SECURE, 
    458            OPT_USE_TURN,OPT_ICE_NO_HOST, OPT_TURN_SRV, OPT_TURN_TCP, 
     459           OPT_USE_TURN, OPT_ICE_NO_HOST, OPT_TURN_SRV, OPT_TURN_TCP, 
    459460           OPT_TURN_USER, OPT_TURN_PASSWD, 
    460461           OPT_PLAY_FILE, OPT_PLAY_TONE, OPT_RTP_PORT, OPT_ADD_CODEC,  
     
    483484        { "color",      0, 0, OPT_COLOR}, 
    484485        { "no-color",   0, 0, OPT_NO_COLOR}, 
     486        { "light-bg",           0, 0, OPT_LIGHT_BG}, 
    485487        { "help",       0, 0, OPT_HELP}, 
    486488        { "version",    0, 0, OPT_VERSION}, 
     
    652654            break; 
    653655 
     656        case OPT_LIGHT_BG: 
     657            pj_log_set_color(1, PJ_TERM_COLOR_R); 
     658            pj_log_set_color(2, PJ_TERM_COLOR_R | PJ_TERM_COLOR_G); 
     659            pj_log_set_color(3, PJ_TERM_COLOR_B | PJ_TERM_COLOR_G); 
     660            pj_log_set_color(4, 0); 
     661            pj_log_set_color(5, 0); 
     662            pj_log_set_color(77, 0); 
     663            break; 
     664 
    654665        case OPT_HELP: 
    655666            usage(); 
Note: See TracChangeset for help on using the changeset viewer.