Skip to content

Commit

Permalink
log: fix log level in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstruck committed Oct 1, 2019
1 parent 390b6b1 commit b037525
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
4 changes: 2 additions & 2 deletions cmd/kvload/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/bmeg/grip/log"
"github.com/bmeg/grip/util"
"github.com/paulbellamy/ratecounter"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

Expand All @@ -37,7 +37,7 @@ var Cmd = &cobra.Command{

graph = args[0]

log.GetLogger().SetLevel(logrus.DebugLevel)
log.GetLogger().SetLevel(logrus.DebugLevel)

// Create the graph if it doesn't already exist.
// Creating the graph also results in the creation of indices
Expand Down
42 changes: 12 additions & 30 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,80 +265,62 @@ func ConfigureLogger(conf Logger) {

// Debug log message
func Debug(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Debug(args...)
}

// Debugln log message
func Debugln(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Debugln(args...)
}

// Debugf log message
func Debugf(format string, args ...interface{}) {
logger.Debug(fmt.Sprintf(format, args...))
logger.Debugf(format, args...)
}

// Info log message
func Info(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Info(args...)
}

// Infoln log message
func Infoln(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Infoln(args...)
}

// Infof log message
func Infof(format string, args ...interface{}) {
logger.Debug(fmt.Sprintf(format, args...))
logger.Infof(format, args...)
}

// Warning log message
func Warning(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Warning(args...)
}

// Warningln log message
func Warningln(args ...interface{}) {
logger.Debug(fmt.Sprint(args...))
logger.Warningln(fmt.Sprint(args...))
}

// Warningf log message
func Warningf(format string, args ...interface{}) {
logger.Debug(fmt.Sprintf(format, args...))
logger.Warningf(format, args...)
}

// Error log message
func Error(args ...interface{}) {
logger.Error(fmt.Sprint(args...))
logger.Error(args...)
}

// Errorln log message
func Errorln(args ...interface{}) {
logger.Error(fmt.Sprint(args...))
logger.Errorln(args...)
}

// Errorf log message
func Errorf(format string, args ...interface{}) {
logger.Error(fmt.Sprintf(format, args...))
}

// Fatal log message
func Fatal(args ...interface{}) {
logger.Error(fmt.Sprint(args...))
os.Exit(1)
}

// Fatalln log message
func Fatalln(args ...interface{}) {
logger.Error(fmt.Sprint(args...))
os.Exit(1)
}

// Fatalf log message
func Fatalf(format string, args ...interface{}) {
logger.Error(fmt.Sprintf(format, args...))
os.Exit(1)
logger.Errorf(format, args...)
}

// Fields type, used to pass to `WithFields`.
Expand Down

0 comments on commit b037525

Please sign in to comment.