Merge pull request #2635 from ZhouBox/v2.11

[v2.11]metrics:add debug log
This commit is contained in:
fengzeroz
2025-12-12 17:44:01 +08:00
committed by GitHub
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -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);
+4 -3
View File
@@ -18,6 +18,7 @@
**/
#include <dirent.h>
#include <errno.h>
#include <pthread.h>
#include <sys/statvfs.h>
#include <sys/sysinfo.h>
@@ -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;
}