Changeset 2686


Ignore:
Timestamp:
May 7, 2009 4:56:04 PM (10 years ago)
Author:
bennylp
Message:

Ticket #827: Option in PJSUA-LIB logging config to append existing log file (thanks Robert Cichielo for the suggestion)

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r2661 r2686  
    471471     */ 
    472472    pj_str_t    log_filename; 
     473 
     474    /** 
     475     * Additional flags to be given to #pj_file_open() when opening 
     476     * the log file. By default, the flag is PJ_O_WRONLY. Application 
     477     * may set PJ_O_APPEND here so that logs are appended to existing 
     478     * file instead of overwriting it. 
     479     * 
     480     * Default is 0. 
     481     */ 
     482    unsigned    log_file_flags; 
    473483 
    474484    /** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r2506 r2686  
    477477    /* If output log file is desired, create the file: */ 
    478478    if (pjsua_var.log_cfg.log_filename.slen) { 
    479  
     479        unsigned flags = PJ_O_WRONLY; 
     480        flags |= pjsua_var.log_cfg.log_file_flags; 
    480481        status = pj_file_open(pjsua_var.pool,  
    481482                              pjsua_var.log_cfg.log_filename.ptr, 
    482                               PJ_O_WRONLY,  
     483                              flags,  
    483484                              &pjsua_var.log_file); 
    484485 
Note: See TracChangeset for help on using the changeset viewer.