aboutsummaryrefslogtreecommitdiff
path: root/log.c (unfollow)
Commit message (Collapse)AuthorLines
2024-07-18log: respect the NO_COLOR environment variableDaniel Eklöf-1/+7
http://no-color.org/ Closes #1771
2024-04-05log: fix syslog not respecting the configured log levelDaniel Eklöf-0/+3
2024-02-05util: add streq() function and use in place of strcmp(...) == 0Craig Barnes-1/+1
2022-12-02log: don’t default to syslog enabledDaniel Eklöf-2/+7
Initialize the global ‘do_syslog’ variable to false. This ensures any log calls done before log_init() has been called (e.g. unit tests) doesn’t syslog anything. As a side effect, such log calls no longer open an implicit syslog file descriptor; this is how this “bug” was found: valgrind detected an unclosed file descriptor at exit. Finally, completely disable syslogging if log-level is “none”.
2021-09-15log: simplify Boolean logic for setting "colorize" var in log_init()Craig Barnes-1/+1
2021-06-26log: add LOG_CLASS_NONE and use as initializer for log_levelCraig Barnes-43/+45
This means that logging will be completely disabled until log_init() has been called, which is useful to prevent log spam when running UNITTEST{} blocks in debug builds. Note that this doesn't change the default log level at runtime, which was already being set to LOG_CLASS_INFO in main.c and client.c. The new log level is also exposed to the command-line interface as `--log-level=none`, which allows disabling logging entirely.
2021-05-07log: add va_list versions of log_* functionsDaniel Eklöf-27/+51
2021-02-21errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiersDaniel Eklöf-3/+3
2021-02-11main: client: factor out some common code for "--log-level" optionCraig Barnes-0/+40
2021-02-09log: log-level applies to messages logged to stderr tooDaniel Eklöf-2/+7
2021-01-16debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes-2/+2
2021-01-16Print stack trace on assert() failure or when calling fatal_error()Craig Barnes-6/+6
Note: this uses the __sanitizer_print_stack_trace() function from the AddressSanitizer runtime, so it only works when AddressSanitizer is in use.
2020-10-10selection: use appropriate check for PRIMARY pasteSergey Nazaryev-151/+66
Assume it could be a copy-paste typo. We should check PRIMARY, not CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything to CLIPBOARD.
2020-08-07Replace GCC "unused" and "format" attributes with portable macrosCraig Barnes-2/+1
2020-08-06log: simplify _sys_log() functionCraig Barnes-25/+6
2020-08-02Replace non-portable "\e" escape in string literals with "\033"Craig Barnes-4/+4
2020-02-16log: always log file:linenoDaniel Eklöf-4/+0
2020-02-05main: add --print-pid=FILE|FDDaniel Eklöf-10/+15
When specified, our PID is written to the specified file (or FD), after we've successfully started up.
2020-02-04log: log to stderr, not stdoutDaniel Eklöf-9/+9
2019-12-17log: caller can control syslog levelDaniel Eklöf-3/+15
2019-11-20log: set syslog facility to LOG_DAEMON when run in server modeDaniel Eklöf-5/+10
2019-11-05scan-build: fix a couple of minor warnings from a scan-build runDaniel Eklöf-1/+1
2019-07-30log: syslog: tag unused function arguments as unusedDaniel Eklöf-2/+4
2019-07-30log: log to syslog tooDaniel Eklöf-3/+66
2019-06-29log: don't syslogDaniel Eklöf-66/+3