From 48e321cdbce267d925df8715b57f12aceceb21d4 Mon Sep 17 00:00:00 2001 From: YongHaoHu Date: Wed, 9 Oct 2019 11:24:01 +0800 Subject: [PATCH] consumer logger: Add set level. --- consumer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/consumer.go b/consumer.go index 52b2eb1f..e5438184 100644 --- a/consumer.go +++ b/consumer.go @@ -223,6 +223,13 @@ func (r *Consumer) SetLogger(l logger, lvl LogLevel) { r.logLvl = lvl } +func (r *Consumer) SetLoggerLevel(lvl LogLevel) { + r.logGuard.Lock() + defer r.logGuard.Unlock() + + r.logLvl = lvl +} + func (r *Consumer) getLogger() (logger, LogLevel) { r.logGuard.RLock() defer r.logGuard.RUnlock()