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:
Василий Толстов 2023-01-07 23:47:27 +03:00 committed by GitHub
parent 4ed99f113b
commit a47a8a90b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,23 @@ func (l *consulLogger) Name() 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 {
fields := make(map[string]interface{}, int(len(args)/2))
for i := 0; i < int(len(args)/2); i += 2 {