From 84cfeadf52dacc923c8d4d91e32c38962732d26d Mon Sep 17 00:00:00 2001 From: "xiang.zhou" Date: Fri, 12 Dec 2025 17:41:38 +0800 Subject: [PATCH] metrics:add debug log --- plugins/restful/metric_handle.c | 4 ++-- src/base/metrics.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/restful/metric_handle.c b/plugins/restful/metric_handle.c index daea80a9..79d109dc 100644 --- a/plugins/restful/metric_handle.c +++ b/plugins/restful/metric_handle.c @@ -118,8 +118,8 @@ static int response(nng_aio *aio, char *content, enum nng_http_status status) nng_http_res_set_status(res, status); nng_http_req *nng_req = nng_aio_get_input(aio, 0); - nlog_info("%s %s [%d]", nng_http_req_get_method(nng_req), - nng_http_req_get_uri(nng_req), status); + nlog_notice("%s %s [%d]", nng_http_req_get_method(nng_req), + nng_http_req_get_uri(nng_req), status); nng_aio_set_output(aio, 0, res); nng_aio_finish(aio, 0); diff --git a/src/base/metrics.c b/src/base/metrics.c index e1e9f47b..ed019b69 100644 --- a/src/base/metrics.c +++ b/src/base/metrics.c @@ -18,6 +18,7 @@ **/ #include +#include #include #include #include @@ -45,7 +46,7 @@ static void find_os_info() FILE *f = popen(cmd, "r"); if (NULL == f) { - nlog_error("popen command fail"); + nlog_error("popen command fail(%s)", strerror(errno)); return; } @@ -100,7 +101,7 @@ static size_t parse_memory_fields(int col) f = popen(buf, "r"); if (NULL == f) { - nlog_error("popen command fail"); + nlog_error("popen command fail(%s)", strerror(errno)); return 0; } @@ -135,7 +136,7 @@ static inline size_t neuron_memory_used() f = popen(buf, "r"); if (NULL == f) { - nlog_error("popen command fail"); + nlog_error("popen command fail(%s)", strerror(errno)); return 0; }