summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author“yangwei” <[email protected]>2019-09-04 11:47:33 +0800
committer“yangwei” <[email protected]>2019-09-04 11:47:33 +0800
commit117720197e57d44cc03a225ab2875288bd087fe1 (patch)
tree28e4a880c65c6f0f97006dd50557a1c8ee55ef7b
parent49822347cb81f3c7fa624c7fa7d8cf75d61da3d8 (diff)
1、调整自动生成的zlog.conf格式
2、更新gitignore内容,增加手动build目录
-rw-r--r--.gitignore1
-rw-r--r--demo/test_handle_logger.c2
-rw-r--r--src/MESA_handle_logger.c3
3 files changed, 4 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 647907e..6862a02 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ core.*
version.txt
demo/test_handle_logger
cmake-build-debug
+build-*/
GPATH
GRTAGS
GTAGS
diff --git a/demo/test_handle_logger.c b/demo/test_handle_logger.c
index 448c14b..71d0a34 100644
--- a/demo/test_handle_logger.c
+++ b/demo/test_handle_logger.c
@@ -101,7 +101,7 @@ int main(int argc, char ** args)
printf("Error, wrong parameter!\n");
return -1;
}
- sample_handle = MESA_create_runtime_log_handle("./log/test_log", RLOG_LV_DEBUG);
+ sample_handle = MESA_create_runtime_log_handle("./log/sample_log", RLOG_LV_DEBUG);
if (sample_handle == NULL)
{
printf("get log sample_handle error\n");
diff --git a/src/MESA_handle_logger.c b/src/MESA_handle_logger.c
index 35a73a4..3ec959f 100644
--- a/src/MESA_handle_logger.c
+++ b/src/MESA_handle_logger.c
@@ -151,7 +151,7 @@ void *MESA_create_runtime_log_handle(const char *file_path, int level)
if(fp == NULL)return NULL;
char zlog_rule_conf_content[MAX_HANDLE_LOG_PATH + 1];
snprintf(zlog_rule_conf_content, sizeof(zlog_rule_conf_content),
- "[global] \n default format = \"%%d(%%c), %%V, %%m%%n\" \n[levels]\n DEBUG=10\n INFO=20\n FATAL=30\n[rules]\n %s.* \"%s.%%d(%%F)\"",
+ "[global]\ndefault format = \"%%d(%%c), %%V, %%m%%n\" \n[levels]\nDEBUG=10\nINFO=20\nFATAL=30\n[rules]\n %s.* \"%s.%%d(%%F)\"",
p_name, file_path);
fwrite(zlog_rule_conf_content, strlen(zlog_rule_conf_content), 1, fp);
fclose(fp);
@@ -181,6 +181,7 @@ void MESA_destroy_runtime_log_handle(void *handle)
if(handle != NULL)
{
log_handle_t *p_handle = (log_handle_t *)handle;
+ zlog_fini();
free(handle);
handle = NULL;
}