Skip to content

Commit

Permalink
Merge pull request #27 from codeinuit/add-debug-support-on-loggers
Browse files Browse the repository at this point in the history
(feat) add debug wrap for logger
  • Loading branch information
codeinuit authored May 12, 2024
2 parents 79bd069 + 1c9e86f commit 83f0472
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package logger

// Logger interface implementation
type Logger interface {
Debug(...any)
Debugf(string, ...any)
Info(...any)
Infof(string, ...any)
Warn(...any)
Expand Down
8 changes: 8 additions & 0 deletions pkg/logger/logrus/logrus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/logger/zap/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 83f0472

Please sign in to comment.