add config
This commit is contained in:
@ -29,7 +29,7 @@ func newLogger(name string) *logger {
|
||||
|
||||
// EnableJSONOutput enables JSON formatted output log.
|
||||
func (l *logger) EnableJSONOutput(enabled bool) {
|
||||
|
||||
l.logger.Logger.SetFormatter(&logrus.JSONFormatter{})
|
||||
}
|
||||
|
||||
// SetOutputLevel sets log output level
|
||||
@ -45,44 +45,44 @@ func (l *logger) WithFields(fields map[string]interface{}) Logger {
|
||||
}
|
||||
}
|
||||
|
||||
// Info logs a message at level Info.
|
||||
func (l *logger) Info(args ...interface{}) {
|
||||
l.logger.Log(logrus.InfoLevel, args...)
|
||||
}
|
||||
|
||||
// Infof logs a message at level Info.
|
||||
func (l *logger) Infof(format string, args ...interface{}) {
|
||||
l.logger.Logf(logrus.InfoLevel, format, args...)
|
||||
}
|
||||
|
||||
// Debug logs a message at level Debug.
|
||||
func (l *logger) Debug(args ...interface{}) {
|
||||
l.logger.Log(logrus.DebugLevel, args...)
|
||||
l.logger.Debug(args...)
|
||||
}
|
||||
|
||||
// Debugf logs a message at level Debug.
|
||||
func (l *logger) Debugf(format string, args ...interface{}) {
|
||||
l.logger.Logf(logrus.DebugLevel, format, args...)
|
||||
l.logger.Debugf(format, args...)
|
||||
}
|
||||
|
||||
// Info logs a message at level Info.
|
||||
func (l *logger) Info(args ...interface{}) {
|
||||
l.logger.Info(args...)
|
||||
}
|
||||
|
||||
// Infof logs a message at level Info.
|
||||
func (l *logger) Infof(format string, args ...interface{}) {
|
||||
l.logger.Infof(format, args...)
|
||||
}
|
||||
|
||||
// Warn logs a message at level Warn.
|
||||
func (l *logger) Warn(args ...interface{}) {
|
||||
l.logger.Log(logrus.WarnLevel, args...)
|
||||
l.logger.Warn(args...)
|
||||
}
|
||||
|
||||
// Warnf logs a message at level Warn.
|
||||
func (l *logger) Warnf(format string, args ...interface{}) {
|
||||
l.logger.Logf(logrus.WarnLevel, format, args...)
|
||||
l.logger.Warnf(format, args...)
|
||||
}
|
||||
|
||||
// Error logs a message at level Error.
|
||||
func (l *logger) Error(args ...interface{}) {
|
||||
l.logger.Log(logrus.ErrorLevel, args...)
|
||||
l.logger.Error(args...)
|
||||
}
|
||||
|
||||
// Errorf logs a message at level Error.
|
||||
func (l *logger) Errorf(format string, args ...interface{}) {
|
||||
l.logger.Logf(logrus.ErrorLevel, format, args...)
|
||||
l.logger.Errorf(format, args...)
|
||||
}
|
||||
|
||||
// Fatal logs a message at level Fatal then the process will exit with status set to 1.
|
||||
|
Reference in New Issue
Block a user