Skip to content

Commit

Permalink
Remove redundant log function
Browse files Browse the repository at this point in the history
Bump logrus so that we can use logrus.StandardLogger().Logf instead

Co-authored-by: Julia Nedialkova <julianedialkova@hotmail.com>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
  • Loading branch information
georgethebeatle and yulianedyalkova committed Apr 22, 2019
1 parent ba3cabf commit 475aef1
Show file tree
Hide file tree
Showing 24 changed files with 892 additions and 529 deletions.
21 changes: 1 addition & 20 deletions libcontainer/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,7 @@ func processEntry(text []byte) {
logrus.Errorf("failed to parse log level %q: %v\n", jl.Level, err)
return
}
log(lvl, jl.Msg)
}

func log(level logrus.Level, args ...interface{}) {
switch level {
case logrus.PanicLevel:
logrus.Panic(args...)
case logrus.FatalLevel:
logrus.Fatal(args...)
case logrus.ErrorLevel:
logrus.Error(args...)
case logrus.WarnLevel:
logrus.Warn(args...)
case logrus.InfoLevel:
logrus.Info(args...)
case logrus.DebugLevel:
logrus.Debug(args...)
default:
logrus.Warnf("Unsupported log level %v while trying to log '%#v'", level, args)
}
logrus.StandardLogger().Logf(lvl, jl.Msg)
}

func ConfigureLogging(config Config) error {
Expand Down
2 changes: 1 addition & 1 deletion vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ github.com/checkpoint-restore/go-criu v3.11
github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08
github.com/opencontainers/selinux v1.2.1
github.com/seccomp/libseccomp-golang 84e90a91acea0f4e51e62bc1a75de18b1fc0790f
github.com/sirupsen/logrus a3f95b5c423586578a4e099b11a46c2479628cac
github.com/sirupsen/logrus 8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
github.com/vishvananda/netlink 1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270
# systemd integration.
Expand Down
97 changes: 44 additions & 53 deletions vendor/github.com/sirupsen/logrus/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions vendor/github.com/sirupsen/logrus/alt_exit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 475aef1

Please sign in to comment.