From 48a9df043df64887cb99e03d7613379c947d11d8 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Tue, 17 Feb 2026 11:57:52 +0100 Subject: Add configurable log level as optional CLI argument All three programs now accept an optional second argument [log-level] (trace, debug, info, warning, error, fatal) defaulting to info. The level is applied by setting the logger context pointer directly, avoiding a memory leak that would occur from overwriting the heap-allocated logger struct. Also documents the ASan leak-check workflow in CLAUDE.md. --- src/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h index e3d2f4c..e8c0c78 100644 --- a/src/common.h +++ b/src/common.h @@ -43,6 +43,17 @@ UA_Server *createSecureServer (UA_UInt16 port, const char *applicationUri, char **trustPaths, size_t trustSize, UA_StatusCode *retval); +/** + * @brief Parses a log-level name into the corresponding UA_LogLevel value. + * + * Accepted names (case-sensitive): "trace", "debug", "info", "warning", + * "error", "fatal". + * + * @param name Log-level name string. + * @return The matching UA_LogLevel, or -1 if the name is not recognized. + */ +int parseLogLevel (const char *name); + /** * @brief Parses a security mode name into the corresponding enum value. * -- cgit v1.2.3