Skip to content

Commit

Permalink
Merge pull request #2 from little-cui/master
Browse files Browse the repository at this point in the history
Add options convert func
  • Loading branch information
tianxiaoliang authored Aug 5, 2021
2 parents 1264c01 + 382152b commit d2c0b42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ func WithErr(d error) Option {
}
}

func ToOptions(opts ...Option) *Options {
option := &Options{}
for _, opt := range opts {
opt(option)
}
return option
}

// Logger is a interface for log tool
type Logger interface {
Debug(message string, opts ...Option)
Expand Down

0 comments on commit d2c0b42

Please sign in to comment.