From fcedfddf00b3f994e4f4e40332ac7fc192c63244 Mon Sep 17 00:00:00 2001 From: polwex Date: Sun, 5 Oct 2025 21:56:51 +0700 Subject: claude is gud --- vere/pkg/noun/log.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 vere/pkg/noun/log.c (limited to 'vere/pkg/noun/log.c') diff --git a/vere/pkg/noun/log.c b/vere/pkg/noun/log.c new file mode 100644 index 0000000..ee1888e --- /dev/null +++ b/vere/pkg/noun/log.c @@ -0,0 +1,40 @@ +/// @file + +#include "log.h" + +#include + +#include "options.h" + +void +u3l_log(const char* format, ...) +{ + va_list myargs; + va_start(myargs, format); + + if (u3C.stderr_log_f) { + // the user set their own logging function. render the line and redirect + // to them. + // + char msg[4096]; + vsnprintf(msg, 4096, format, myargs); + u3C.stderr_log_f(msg); + } else { + // this process did not set a logging function, fallback to stderr + // + vfprintf(stderr, format, myargs); + fprintf(stderr, "\r\n"); + fflush(stderr); + } + + va_end(myargs); +} + +u3_weak +u3l_punt(const char* name, u3_weak pro) +{ + if ( u3_none == pro ) { + u3l_log("%s-punt", name); + } + return pro; +} -- cgit v1.2.3