Augustin Fabre
|
9c0b6a66a4
|
Rework logging logic
This commit fixes issue #42 [0].
Debug level messages are masked unless option `-d' (debug) is used. In this
case, all messages are also printed to stderr.
syslog.h is included in the base POSIX only since issue 6 (POSIX:2001) [1].
`LOG_UPTO' is an extension, not defined by POSIX; an implementation is provided
here for platforms where it is missing.
This code is inspired by OpenBSD's httpd(8) logging functions [2].
[0] https://github.com/gophernicus/gophernicus/issues/42
[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/setlogmask.html
[2] https://cvsweb.openbsd.org/src/usr.sbin/httpd/log.c?rev=1.14&content-type=text/x-cvsweb-markup
|
2020-10-12 20:21:06 +02:00 |
|