'\" t
.\" Title: nutscan_set_debug_level
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 04/07/2026
.\" Manual: NUT Manual
.\" Source: Network UPS Tools 2.8.5
.\" Language: English
.\"
.TH "NUTSCAN_SET_DEBUG_LE" "3" "04/07/2026" "Network UPS Tools 2\&.8\&.5" "NUT Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "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 \- manipulate the possibly separate (identified via cookie) debugging level and sub\-process tags for NUT common code in the nutscan library; propagate to `libupsclient` if already loaded\&.
.SH "SYNOPSIS"
.sp
.nf
#include
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);
.fi
.SH "DESCRIPTION"
.sp
The NUT common library code is included in several other libraries, often with their private copies of variables, so we want to synchronize them\&.
.sp
It can get even more confusing with libnutprivate\-common being a shared dynamically loaded library instance behind both the program and libnutscan (and maybe further libupsclient), hence the cookies: direct NUT\-common code consumers like NUT in\-tree clients can use their nut_common_cookie() value to pass into methods here\&. Third\-party clients may safely pass \fINULL\fR\&.
.sp
The \fBnutscan_set_debug_level()\fR function sets internal debug verbosity for common NUT code in the library and optionally into the loaded libupsclient (\fBnutscan_init()\fR function must be called at least once before this then)\&.
.sp
If internal upslog_start value is not yet set, we can set it with \fBnutscan_upslog_start_sync()\fR from *tv (or current time if tv==NULL), otherwise the method is no\-op (keep and report the original setting)\&.
.sp
Returns the pointer to the currently set value, so it can be propagated or used in difftime() computations\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
In WIN32 builds also enforces line\-buffering for stdout and stderr streams\&.
.sp .5v
.RE
.SH "NOTES"
.sp
Technically, the function is currently defined in \fInutscan\-init\&.h\fR file\&.
.sp
For legacy reasons, the nut_debug_level (or its copy from the NUT common library objects linked into libnutscan) and setproctag() method are also exposed, but should not be used directly; may be removed in later releases\&.
.SH "SEE ALSO"
.sp
\fBnutscan_init\fR(3), \fBupscli_set_debug_level\fR(3)