github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/mlog/sugar.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package mlog 5 6 import "go.uber.org/zap" 7 8 // Made for the plugin interface, use the regular logger for other uses 9 type SugarLogger struct { 10 wrappedLogger *Logger 11 zapSugar *zap.SugaredLogger 12 } 13 14 func (l *SugarLogger) Debug(msg string, keyValuePairs ...interface{}) { 15 l.zapSugar.Debugw(msg, keyValuePairs...) 16 } 17 18 func (l *SugarLogger) Info(msg string, keyValuePairs ...interface{}) { 19 l.zapSugar.Infow(msg, keyValuePairs...) 20 } 21 22 func (l *SugarLogger) Error(msg string, keyValuePairs ...interface{}) { 23 l.zapSugar.Errorw(msg, keyValuePairs...) 24 } 25 26 func (l *SugarLogger) Warn(msg string, keyValuePairs ...interface{}) { 27 l.zapSugar.Warnw(msg, keyValuePairs...) 28 }