1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00

log: Disable log rate limiting if debug logging is enabled

When debugging, it makes sense to not do any rate limiting at all.
This commit is contained in:
Daan De Meyer 2022-11-16 11:37:14 +01:00
parent 8522691d4d
commit a423050e28

View File

@ -388,7 +388,7 @@ typedef struct LogRateLimit {
_log_ratelimit.error = _log_ratelimit_error; \
_log_ratelimit.level = _log_ratelimit_level; \
} \
if (ratelimit_below(&_log_ratelimit.ratelimit)) \
if (log_get_max_level() == LOG_DEBUG || ratelimit_below(&_log_ratelimit.ratelimit)) \
_log_ratelimit_error = _num_dropped_errors > 0 \
? log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format " (Dropped %u similar message(s))", ##__VA_ARGS__, _num_dropped_errors) \
: log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format, ##__VA_ARGS__); \