int switch_storage(STORAGE_T old_storage, STORAGE_T new_storage) { aplogd_logfile_max = aplogd_get_filesize(new_storage); aplogd_close_output(); if (aplogd_output_setup(new_storage)<0){ ALOGE("aplogd_output_setup in %s failed.",g_output_path[new_storage]); aplogd_output_setup(old_storage); return old_storage; } return new_storage; }
void aplogd_config_load(void) { DPRINT("Enter aplogd_config_load.\n"); aplogd_io_array[APLOGD_INPUT_MAIN_POLL_INDEX].collect_flag = aplogd_is_collected('m'); aplogd_io_array[APLOGD_INPUT_RADIO_POLL_INDEX].collect_flag = aplogd_is_collected('r'); aplogd_io_array[APLOGD_INPUT_EVENTS_POLL_INDEX].collect_flag = aplogd_is_collected('e'); aplogd_io_array[APLOGD_INPUT_SYSTEM_POLL_INDEX].collect_flag = aplogd_is_collected('s'); aplogd_io_array[APLOGD_INPUT_KERNEL_POLL_INDEX].collect_flag = aplogd_is_collected('k'); setLogFormat(usr_cfg_format); aplogd_io_array[APLOGD_VOLD_STATUS_POLL_INDEX].collect_flag=1; g_current_storage = aplogd_calc_storage_pref(); aplogd_logfile_max=aplogd_get_filesize(g_current_storage); DPRINT("aplogd_logfile_max=%d.\n",aplogd_logfile_max); }