NUTSCAN_SET_DEBUG_LE(3)

πŸ“¦
version 2.8.5 Β· 4 versions
, in arch rolling

πŸ’… NUTSCAN_SET_DEBUG_LE(3) β€” bestie edition πŸŽ€

okay so this is page NUTSCAN_SET_DEBUG_LE(3) from the NUT Manual, and honestly? it's giving "I contain multitudes" because there are like seven functions on this one page. buckle up πŸ¦‹


✨ NAME ✨

nutscan_upslog_set_debug_level, nutscan_upslog_get_debug_level, nutscan_upslog_cookie, nutscan_upslog_setprocname, nutscan_upslog_setproctag, nutscan_upslog_getproctag, nutscan_upslog_start_sync β€” these little icons manipulate the debugging level and the sub-process tags for NUT common code inside the nutscan library, and like… the debugging level might be a separate one, identified via cookie, no cap πŸͺ. and they also propagate all that over to libupsclient if it's already loaded. iykyk.


✨ SYNOPSIS ✨

#include <nut-scan.h>

const void *nutscan_upslog_cookie(void);

void nutscan_set_debug_level(int level), const void *cookie;
int  nutscan_get_debug_level(void);

void nutscan_setprocname(const char *full_procname, const void *cookie);
void nutscan_setproctag(const char *tag, const void *cookie);
const char *nutscan_getproctag(void);

struct timeval *nutscan_upslog_start_sync(struct timeval *tv, const void *cookie);

(and yes, that comma in the nutscan_set_debug_level line is exactly how it's written, don't come for me πŸ’€)


✨ DESCRIPTION ✨

the NUT common library code gets bundled into several other libraries, and like… each one often has its own private copies of the variables 😭 so yeah, we wanna synchronize them. team work makes the dream work, periodt.

and it gets even more unhinged when libnutprivate-common is a shared dynamically loaded library instance sitting behind both the program and libnutscan (and maybe further libupsclient too) β€” hence the cookies πŸͺ. direct NUT-common code consumers, like the NUT in-tree clients, can use their nut_common_cookie() value and pass it into methods here. third-party clients? you're totally safe to pass NULL, you're valid, you're iconic 🫢.

the nutscan_set_debug_level() function sets the internal debug verbosity for common NUT code in the library, and optionally into the loaded libupsclient β€” but heads up bestie, nutscan_init() function must be called at least once before this then. no skipping steps πŸ™ˆ.

if the internal upslog_start value is not yet set, we can set it with nutscan_upslog_start_sync() from *tv (or the current time if tv==NULL). otherwise the method is a no-op β€” it keeps and reports the original setting, main character energy, it does not move πŸ‘‘.

it returns the pointer to the currently set value, so it can be propagated or used in difftime() computations. very demure, very useful ✨.

🚨 Note 🚨 in WIN32 builds it also enforces line-buffering for the stdout and stderr streams. lowkey important.

🌸 NOTES 🌸

technically (πŸ€“), the function is currently defined in the nutscan-init.h file.

and for legacy reasons, the nut_debug_level (or its copy from the NUT common library objects linked into libnutscan) and the setproctag() method are also exposed β€” but bestie, do not use them directly. they may be removed in later releases πŸ’€. it's giving deprecated, it's giving "leave it alone".


πŸ¦‹ SEE ALSO πŸ¦‹


okay that's the whole page, you ate that πŸ’…βœ¨

Network UPS Tools 2.8.5 πŸ“ β€” dated 06/21/2026, mwah πŸ’– go forth and debug, queen πŸ‘‘

πŸ“¦ where this page comes from
  • arch rolling: nut 2.8.5-2 Β· GPL-2.0-or-later AND GPL-3.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms