Ignore:
Timestamp:
Sep 18, 2011 2:59:56 PM (13 years ago)
Author:
bennylp
Message:

Modified the libraries to use the new log indentation feature re #1372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r3683 r3753  
    375375    pjsua_acc *acc; 
    376376    unsigned i, id; 
    377     pj_status_t status; 
    378  
     377    pj_status_t status = PJ_SUCCESS; 
     378 
     379    PJ_ASSERT_RETURN(cfg, PJ_EINVAL); 
    379380    PJ_ASSERT_RETURN(pjsua_var.acc_cnt < PJ_ARRAY_SIZE(pjsua_var.acc), 
    380381                     PJ_ETOOMANY); 
     
    385386    /* Verify media count */ 
    386387#if !defined(PJMEDIA_HAS_VIDEO) || (PJMEDIA_HAS_VIDEO == 0) 
     388    /* Enable PJMEDIA_HAS_VIDEO in your config_site.h! */ 
    387389    PJ_ASSERT_RETURN(cfg->max_video_cnt == 0, PJ_EINVAL); 
    388390#endif 
    389391    PJ_ASSERT_RETURN(cfg->max_audio_cnt + cfg->max_video_cnt <=  
    390392                     PJSUA_MAX_CALL_MEDIA, PJ_ETOOMANY); 
     393 
     394    PJ_LOG(4,(THIS_FILE, "Adding account: id=%.*s", 
     395              (int)cfg->id.slen, cfg->id.ptr)); 
     396    pj_log_push_indent(); 
    391397 
    392398    PJSUA_LOCK(); 
     
    434440    for (i=0; i<acc->cfg.proxy_cnt; ++i) { 
    435441        status = normalize_route_uri(acc->pool, &acc->cfg.proxy[i]); 
    436         if (status != PJ_SUCCESS) 
     442        if (status != PJ_SUCCESS) { 
     443            PJSUA_UNLOCK(); 
     444            pj_log_pop_indent(); 
    437445            return status; 
     446        } 
    438447    } 
    439448 
     
    444453        acc->pool = NULL; 
    445454        PJSUA_UNLOCK(); 
     455        pj_log_pop_indent(); 
    446456        return status; 
    447457    } 
     
    469479    } 
    470480 
     481    pj_log_pop_indent(); 
    471482    return PJ_SUCCESS; 
    472483} 
     
    575586    PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 
    576587 
     588    PJ_LOG(4,(THIS_FILE, "Deleting account %d..", acc_id)); 
     589    pj_log_push_indent(); 
     590 
    577591    PJSUA_LOCK(); 
    578592 
     
    625639    PJ_LOG(4,(THIS_FILE, "Account id %d deleted", acc_id)); 
    626640 
     641    pj_log_pop_indent(); 
    627642    return PJ_SUCCESS; 
    628643} 
     
    656671                     PJSUA_MAX_CALL_MEDIA, PJ_ETOOMANY); 
    657672 
     673    PJ_LOG(4,(THIS_FILE, "Modifying accunt %d", acc_id)); 
     674    pj_log_push_indent(); 
    658675 
    659676    PJSUA_LOCK(); 
     
    10411058on_return: 
    10421059    PJSUA_UNLOCK(); 
     1060    pj_log_pop_indent(); 
    10431061    return status; 
    10441062} 
     
    10561074    PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 
    10571075 
     1076    PJ_LOG(4,(THIS_FILE, "Acc %d: setting online status to %d..", 
     1077              acc_id, is_online)); 
     1078    pj_log_push_indent(); 
     1079 
    10581080    pjsua_var.acc[acc_id].online_status = is_online; 
    10591081    pj_bzero(&pjsua_var.acc[acc_id].rpid, sizeof(pjrpid_element)); 
    10601082    pjsua_pres_update_acc(acc_id, PJ_FALSE); 
     1083 
     1084    pj_log_pop_indent(); 
    10611085    return PJ_SUCCESS; 
    10621086} 
     
    10741098    PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 
    10751099 
     1100    PJ_LOG(4,(THIS_FILE, "Acc %d: setting online status to %d..", 
     1101              acc_id, is_online)); 
     1102    pj_log_push_indent(); 
     1103 
    10761104    PJSUA_LOCK(); 
    10771105    pjsua_var.acc[acc_id].online_status = is_online; 
     
    10801108 
    10811109    pjsua_pres_update_acc(acc_id, PJ_TRUE); 
     1110    pj_log_pop_indent(); 
     1111 
    10821112    return PJ_SUCCESS; 
    10831113} 
     
    16651695        return; 
    16661696 
     1697    pj_log_push_indent(); 
    16671698    PJSUA_LOCK(); 
    16681699 
     
    17161747            if (acc_check_nat_addr(acc, param)) { 
    17171748                PJSUA_UNLOCK(); 
     1749                pj_log_pop_indent(); 
    17181750                return; 
    17191751            } 
     
    17781810     
    17791811    PJSUA_UNLOCK(); 
     1812    pj_log_pop_indent(); 
    17801813} 
    17811814 
     
    19651998    PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP); 
    19661999 
     2000    PJ_LOG(4,(THIS_FILE, "Acc %d: setting %sregistration..", 
     2001              acc_id, (renew? "" : "un"))); 
     2002    pj_log_push_indent(); 
     2003 
    19672004    PJSUA_LOCK(); 
    19682005 
     
    20402077                     status); 
    20412078    } else { 
    2042         PJ_LOG(3,(THIS_FILE, "%s sent", 
     2079        PJ_LOG(4,(THIS_FILE, "Acc %d: %s sent", acc_id, 
    20432080                 (renew? "Registration" : "Unregistration"))); 
    20442081    } 
     
    20462083on_return: 
    20472084    PJSUA_UNLOCK(); 
     2085    pj_log_pop_indent(); 
    20482086    return status; 
    20492087} 
     
    27912829        return; 
    27922830 
     2831    PJ_LOG(4,(THIS_FILE, "Disconnected notification for transport %s", 
     2832              tp->obj_name)); 
     2833    pj_log_push_indent(); 
     2834 
    27932835    /* Shutdown this transport, to make sure that the transport manager  
    27942836     * will create a new transport for reconnection. 
     
    28182860 
    28192861    PJSUA_UNLOCK(); 
    2820 } 
     2862    pj_log_pop_indent(); 
     2863} 
Note: See TracChangeset for help on using the changeset viewer.