fix internal logger wrapper (#106)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
4ed99f113b
commit
a47a8a90b9
17
logger.go
17
logger.go
@ -23,6 +23,23 @@ func (l *consulLogger) Name() string {
|
|||||||
return l.logger.String()
|
return l.logger.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *consulLogger) GetLevel() hclog.Level {
|
||||||
|
switch l.logger.Options().Level {
|
||||||
|
case logger.DebugLevel:
|
||||||
|
return hclog.Debug
|
||||||
|
case logger.TraceLevel:
|
||||||
|
return hclog.Trace
|
||||||
|
case logger.InfoLevel:
|
||||||
|
return hclog.Info
|
||||||
|
case logger.WarnLevel:
|
||||||
|
return hclog.Warn
|
||||||
|
case logger.ErrorLevel:
|
||||||
|
return hclog.Error
|
||||||
|
default:
|
||||||
|
return hclog.Info
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (l *consulLogger) With(args ...interface{}) hclog.Logger {
|
func (l *consulLogger) With(args ...interface{}) hclog.Logger {
|
||||||
fields := make(map[string]interface{}, int(len(args)/2))
|
fields := make(map[string]interface{}, int(len(args)/2))
|
||||||
for i := 0; i < int(len(args)/2); i += 2 {
|
for i := 0; i < int(len(args)/2); i += 2 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user