Skip to content

Commit 7e2a9dd

Browse files
committed
tests/test_authconf.c: honour NUT_DEBUG_LEVEL [#3329]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 6d5395c commit 7e2a9dd

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/test_authconf.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ int main(int argc, char **argv)
2626
FILE *f;
2727
upscli_authconf_t *ac;
2828
size_t num_sections;
29-
char buf[512];
29+
char buf[512], *s;
30+
int l;
31+
32+
s = getenv("NUT_DEBUG_LEVEL");
33+
if (s && str_to_int(s, &l, 10) && l > 0) {
34+
nut_debug_level = l;
35+
upsdebugx(1, "Defaulting debug verbosity to NUT_DEBUG_LEVEL=%d "
36+
"since none was requested by command-line options", l);
37+
}
3038

3139
if (argc > 1) {
3240
upsdebugx(1, "Args ignored: '%s' etc.", argv[0]);

0 commit comments

Comments
 (0)