ratelimit: fix log levels of log suppression messages

When logging a suppression message do so on the same log level as the
suppressed messages.

Cherry picked by Colin Guthrie from ec5a785712
with a couple of additional changes due to extra limiting in master
that was not present in stable-queue.
This commit is contained in:
Lennart Poettering 2011-01-22 01:08:36 +01:00 committed by Colin Guthrie
parent a509f10f95
commit 1250b5d735
13 changed files with 19 additions and 18 deletions

View file

@ -35,7 +35,7 @@ static pa_static_mutex mutex = PA_STATIC_MUTEX_INIT;
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
pa_bool_t pa_ratelimit_test(pa_ratelimit *r) {
pa_bool_t pa_ratelimit_test(pa_ratelimit *r, pa_log_level_t t) {
pa_usec_t now;
pa_mutex *m;
@ -52,7 +52,7 @@ pa_bool_t pa_ratelimit_test(pa_ratelimit *r) {
r->begin + r->interval < now) {
if (r->n_missed > 0)
pa_log_warn("%u events suppressed", r->n_missed);
pa_logl(t, "%u events suppressed", r->n_missed);
r->begin = now;