Skip to content

Commit

Permalink
Update klogrus.go
Browse files Browse the repository at this point in the history
Improve existing documentation
  • Loading branch information
peczenyj authored Dec 3, 2023
1 parent c298e61 commit 439913e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin/klogrus/klogrus.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var (
)

// FieldLogger interface.
// combines logrus.FieldLogger with GetLevel method
// useful to represent a wrapper around *logrus.Logger
type FieldLogger interface {
logrus.FieldLogger
GetLevel() logrus.Level
Expand All @@ -30,6 +32,9 @@ func New(lr *logrus.Logger) *Logger {
}

// NewFieldLogger returns a new Logger using a FieldLogger interface.
// it is isofunctional with New constructor, except it can accept either
// *logrus.Logger or a possible wrapper thaf implements logrus.FieldLogger
// and includes GetLevel method.
func NewFieldLogger(fl FieldLogger) *Logger {
return &Logger{fl}
}
Expand Down

0 comments on commit 439913e

Please sign in to comment.