aboutsummaryrefslogtreecommitdiff
path: root/src/testing/util.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-04 12:56:14 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-04 12:56:14 -0800
commit38d3d03e3b598ca560c487a6930b471a096ffac9 (patch)
tree018dfa8b9f9f1082764d674470b0cd751013a85c /src/testing/util.c
parent604b565ea5a52a78982de8cf5ed263b0d9339bb0 (diff)
downloadnng-38d3d03e3b598ca560c487a6930b471a096ffac9.tar.gz
nng-38d3d03e3b598ca560c487a6930b471a096ffac9.tar.bz2
nng-38d3d03e3b598ca560c487a6930b471a096ffac9.zip
logging: better debug & test logs
Don't emit the log for date change unless we are in debug mode. Emit a newline when starting a new NUTS test. Change the default log level - it was too noisy.
Diffstat (limited to 'src/testing/util.c')
-rw-r--r--src/testing/util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testing/util.c b/src/testing/util.c
index 523fd1cd..497598ed 100644
--- a/src/testing/util.c
+++ b/src/testing/util.c
@@ -172,6 +172,14 @@ nuts_sleep(int msec)
#define NUTS_COLOR_RED_INTENSIVE_ 5
void
+nuts_set_logger(int level)
+{
+ printf("\n"); // force a new line
+ nng_log_set_logger(nng_stderr_logger);
+ nng_log_set_level(level);
+}
+
+void
nuts_logger(nng_log_level level, nng_log_facility fac, const char *msgid,
const char *msg)
{