Skip to content

Instantly share code, notes, and snippets.

@holishing
Created February 19, 2021 14:17
Show Gist options
  • Save holishing/805d6fe46578abfd48a6d92556315cfc to your computer and use it in GitHub Desktop.
Save holishing/805d6fe46578abfd48a6d92556315cfc to your computer and use it in GitHub Desktop.
dreambbs log usage test
From 5eddb5339b3db8352a3b123f23c05cb21844950f Mon Sep 17 00:00:00 2001
From: "0@0" <test@test>
Date: Fri, 19 Feb 2021 22:14:57 +0800
Subject: [PATCH 1/2] log test
---
maple/bbsd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/maple/bbsd.c b/maple/bbsd.c
index 34f5bb8..c37c219 100644
--- a/maple/bbsd.c
+++ b/maple/bbsd.c
@@ -33,7 +33,7 @@
Logger g_logger = {
.file = NULL,
.path = LOG_FILE,
- .lv_skip = LOGLV_WARN,
+ .lv_skip = LOGLV_SKIP_NONE,
};
static const char *argv_default[] = {
@@ -1579,6 +1579,8 @@ static int start_daemon(int argc, char *const argv[])
{
char port_str[12];
sprintf(port_str, "%d", port);
+ LOGF_DEBUG(&g_logger, "%s(): getaddrinfo(NULL, %s, {ai_flags = %d, ai_family = %d, ai_socktype = %d, ai_protocol = %d, ai_addrlen = %d, ai_addr = %x, ai_canonname = %x, ai_next = %x} , &hosts)", __func__, port_str, hints.ai_flags, hints.ai_family, hints.ai_socktype, hints.ai_protocol, hints.ai_addrlen, hints.ai_addr, hints.ai_canonname, hints.ai_next);
+ LOGF_DEBUG(&g_logger, "%s(): getaddrinfo(NULL, %s, &hints , {ai_flags = %d, ai_family = %d, ai_socktype = %d, ai_protocol = %d, ai_addrlen = %d, ai_addr = %x, ai_canonname = %x, ai_next = %x})", __func__, port_str, hosts -> ai_flags, hosts -> ai_family, hosts -> ai_socktype, hosts -> ai_protocol, hosts -> ai_addrlen, hosts -> ai_addr, hosts -> ai_canonname, hosts -> ai_next);
if (getaddrinfo(NULL, port_str, &hints, &hosts))
exit(1);
}
--
2.27.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment