tfe 支持 zlog

This commit is contained in:
luwenpeng
2020-09-24 17:47:35 +08:00
parent 9d15d655ed
commit 95ec503762
13 changed files with 42 additions and 68 deletions

View File

@@ -15,10 +15,6 @@
#include <http2_stream.h>
typedef struct RTLogInit2Data_ {
int run_log_level;
char run_log_path[256];
void *handle;
} RTLogInit2Data;

View File

@@ -18,7 +18,7 @@
#include <http2_common.h>
RTLogInit2Data logging_sc_lid = {
.run_log_level = 1,
};
RTLogInit2Data *logger()

View File

@@ -46,13 +46,7 @@ struct event_timer_ctx
void load_logging_conf(const char *config)
{
RTLogInit2Data *logging_sc_lid = logger();
MESA_load_profile_int_def(config, (const char *)"http",(const char *)"loglevel",
&logging_sc_lid->run_log_level, 10);
MESA_load_profile_string_def(config, (const char *)"http",(const char *)"logfile",
logging_sc_lid->run_log_path, 128, "log/http2.log");
logging_sc_lid->handle = MESA_create_runtime_log_handle(logging_sc_lid->run_log_path, logging_sc_lid->run_log_level);
logging_sc_lid->handle = MESA_create_runtime_log_handle("http2", RLOG_LV_DEBUG);
if(logging_sc_lid->handle == NULL){
TFE_LOG_ERROR(logging_sc_lid->handle, "Create log runtime_log_handle error, init failed!");
}