This commit is contained in:
崔一鸣
2018-08-13 10:07:44 +08:00
parent 8b9360155b
commit 409387b48b

View File

@@ -55,7 +55,7 @@ void* MESA_create_runtime_log_handle(const char *file_path, int level){
el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
std::string logger_id = get_logger_id_by_hash(file_path);
el::Logger* logger = el::Loggers::getLogger(logger_id);
el::Configurations* default_conf = new el::Configurations();
el::Configurations* default_conf = new el::Configurations();
void* handle = NULL;
char* conf_file_path = getenv("MESA_HANDLE_LOGGER_CONF_PATH");
if(conf_file_path == NULL){
@@ -149,6 +149,7 @@ int MESA_read_runtime_log_handle_conf(void* handle, const char* conf_file_path){
return -1;
}
struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
delete(handle1->conf);
el::Configurations* conf = new el::Configurations(conf_file_path);
handle1->conf = conf;
el::Loggers::reconfigureLogger(handle1->logger, *(handle1->conf));
@@ -204,10 +205,10 @@ void MESA_handle_runtime_log(void* handle, int level, const char* module, const
void MESA_destroy_runtime_log_handle(void* handle){
if(handle != NULL){
struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
el::Configurations* conf = handle1->conf;
delete(conf);
free(handle);
struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
el::Configurations* conf = handle1->conf;
delete(conf);
free(handle);
handle = NULL;
}
return;