logger: add Clone method

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-08-30 16:19:35 +03:00
parent 35d3e4b332
commit 2fbaa26f0f
4 changed files with 62 additions and 3 deletions

View File

@@ -20,9 +20,7 @@ type Wrapper interface {
Logf(LogfFunc) LogfFunc
}
var (
_ Logger = &OmitLogger{}
)
var _ Logger = &OmitLogger{}
type OmitLogger struct {
l Logger
@@ -40,6 +38,14 @@ func (w *OmitLogger) V(level Level) bool {
return w.l.V(level)
}
func (w *OmitLogger) Level(level Level) {
w.l.Level(level)
}
func (w *OmitLogger) Clone(opts ...Option) Logger {
return w.l.Clone(opts...)
}
func (w *OmitLogger) Options() Options {
return w.l.Options()
}