Changeset 487 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_console_app.c
- Timestamp:
- Jun 1, 2006 12:28:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_console_app.c
r482 r487 782 782 } 783 783 784 pjsua_pres_refresh( current_acc);784 pjsua_pres_refresh(); 785 785 786 786 } else if (result.uri_result) { … … 815 815 acc_info.acc_id.ptr, 816 816 (acc_info.online_status?"online":"offline")); 817 pjsua_pres_refresh( current_acc);817 pjsua_pres_refresh(); 818 818 break; 819 819 … … 972 972 973 973 /***************************************************************************** 974 * Console application custom logging:975 */976 977 978 static FILE *log_file;979 980 981 static void app_log_writer(int level, const char *buffer, int len)982 {983 /* Write to both stdout and file. */984 985 if (level <= (int)pjsua_get_config()->app_log_level)986 pj_log_write(level, buffer, len);987 988 if (log_file) {989 fwrite(buffer, len, 1, log_file);990 fflush(log_file);991 }992 }993 994 995 pj_status_t pjsua_console_app_logging_init(const pjsua_config *cfg)996 {997 /* Redirect log function to ours */998 999 pj_log_set_log_func( &app_log_writer );1000 1001 /* If output log file is desired, create the file: */1002 1003 if (cfg->log_filename.slen) {1004 log_file = fopen(cfg->log_filename.ptr, "wt");1005 if (log_file == NULL) {1006 PJ_LOG(1,(THIS_FILE, "Unable to open log file %s",1007 cfg->log_filename.ptr));1008 return -1;1009 }1010 }1011 1012 return PJ_SUCCESS;1013 }1014 1015 1016 void pjsua_console_app_logging_shutdown(void)1017 {1018 /* Close logging file, if any: */1019 1020 if (log_file) {1021 fclose(log_file);1022 log_file = NULL;1023 }1024 }1025 1026 /*****************************************************************************1027 974 * Error display: 1028 975 */
Note: See TracChangeset
for help on using the changeset viewer.