From b25a939e2d8b045c083caf3264c4e5aac1cf88fb Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 15 Apr 2025 15:51:40 +0200 Subject: Better logging function Now it is possible to provide some data together with the logging function. This is useful for example in C++, where I can now provide an arbitrary callable object as data, and a simple wrapper function that call the callable object as logging function. --- shell/shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/shell.c b/shell/shell.c index 6b349e5..1ef1a39 100644 --- a/shell/shell.c +++ b/shell/shell.c @@ -780,7 +780,7 @@ set_threads(int argc, char **argv, args_t *args) } void -log_stderr(const char *str) +log_stderr(const char *str, void *unused) { fprintf(stderr, "%s", str); } @@ -792,7 +792,7 @@ main(int argc, char **argv) args_t args; srand(time(NULL)); - nissy_setlogger(log_stderr); + nissy_setlogger(log_stderr, NULL); parse_error = parse_args(argc-1, argv+1, &args); if (parse_error) -- cgit v1.3