Replace glog with logrus

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-01-17 09:23:01 +00:00
parent 383a89b948
commit 3d68005c04
27 changed files with 227 additions and 224 deletions

View File

@@ -23,7 +23,7 @@ import (
"github.com/containerd/containerd/errdefs"
snapshot "github.com/containerd/containerd/snapshots"
"github.com/golang/glog"
"github.com/sirupsen/logrus"
snapshotstore "github.com/containerd/cri-containerd/pkg/store/snapshot"
)
@@ -59,7 +59,7 @@ func (s *snapshotsSyncer) start() {
// check the resource usage and optimize this.
for {
if err := s.sync(); err != nil {
glog.Errorf("Failed to sync snapshot stats: %v", err)
logrus.WithError(err).Error("Failed to sync snapshot stats")
}
<-tick.C
}
@@ -99,7 +99,7 @@ func (s *snapshotsSyncer) sync() error {
usage, err := s.snapshotter.Usage(context.Background(), info.Name)
if err != nil {
if !errdefs.IsNotFound(err) {
glog.Errorf("Failed to get usage for snapshot %q: %v", info.Name, err)
logrus.WithError(err).Errorf("Failed to get usage for snapshot %q", info.Name)
}
continue
}