From 1c9e86feda2080398ebc3707cf2fede8613d4770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Debout=C3=A9?= Date: Sun, 12 May 2024 12:35:36 +0200 Subject: [PATCH] (feat) add debug wrap for logger --- pkg/logger/logger.go | 2 ++ pkg/logger/logrus/logrus.go | 8 ++++++++ pkg/logger/zap/zap.go | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go index 641a990..530c2cd 100644 --- a/pkg/logger/logger.go +++ b/pkg/logger/logger.go @@ -2,6 +2,8 @@ package logger // Logger interface implementation type Logger interface { + Debug(...any) + Debugf(string, ...any) Info(...any) Infof(string, ...any) Warn(...any) diff --git a/pkg/logger/logrus/logrus.go b/pkg/logger/logrus/logrus.go index 51ed2f5..3f24290 100644 --- a/pkg/logger/logrus/logrus.go +++ b/pkg/logger/logrus/logrus.go @@ -13,6 +13,14 @@ func NewLogrusLogger() *LogrusLogger { } } +func (l LogrusLogger) Debug(v ...any) { + l.logger.Debug(v...) +} + +func (l LogrusLogger) Debugf(format string, v ...any) { + l.logger.Debugf(format, v...) +} + func (l LogrusLogger) Info(v ...any) { l.logger.Info(v...) } diff --git a/pkg/logger/zap/zap.go b/pkg/logger/zap/zap.go index 812af9b..ff72dee 100644 --- a/pkg/logger/zap/zap.go +++ b/pkg/logger/zap/zap.go @@ -13,6 +13,14 @@ func NewSugarLogger() ZapSugarLogger { } } +func (z ZapSugarLogger) Debug(v ...any) { + z.logger.Debug(v) +} + +func (z ZapSugarLogger) Debugf(format string, v ...any) { + z.logger.Debugf(format, v...) +} + func (z ZapSugarLogger) Info(v ...any) { z.logger.Info(v) }