From f2686b8db4a2bc08978641730040aa435823b1cf Mon Sep 17 00:00:00 2001 From: yuzou Date: Fri, 15 Apr 2016 11:17:04 +0800 Subject: [PATCH] use context.GetLogger to replace logrus in listener Signed-off-by: yuzou --- notifications/listener.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/notifications/listener.go b/notifications/listener.go index 625e4d24..b99133da 100644 --- a/notifications/listener.go +++ b/notifications/listener.go @@ -3,7 +3,6 @@ package notifications import ( "net/http" - "github.com/Sirupsen/logrus" "github.com/docker/distribution" "github.com/docker/distribution/context" "github.com/docker/distribution/digest" @@ -71,7 +70,7 @@ func (msl *manifestServiceListener) Delete(ctx context.Context, dgst digest.Dige err := msl.ManifestService.Delete(ctx, dgst) if err == nil { if err := msl.parent.listener.ManifestDeleted(msl.parent.Repository.Named(), dgst); err != nil { - logrus.Errorf("error dispatching manifest delete to listener: %v", err) + context.GetLogger(ctx).Errorf("error dispatching manifest delete to listener: %v", err) } } @@ -82,7 +81,7 @@ func (msl *manifestServiceListener) Get(ctx context.Context, dgst digest.Digest, sm, err := msl.ManifestService.Get(ctx, dgst) if err == nil { if err := msl.parent.listener.ManifestPulled(msl.parent.Repository.Named(), sm, options...); err != nil { - logrus.Errorf("error dispatching manifest pull to listener: %v", err) + context.GetLogger(ctx).Errorf("error dispatching manifest pull to listener: %v", err) } } @@ -94,7 +93,7 @@ func (msl *manifestServiceListener) Put(ctx context.Context, sm distribution.Man if err == nil { if err := msl.parent.listener.ManifestPushed(msl.parent.Repository.Named(), sm, options...); err != nil { - logrus.Errorf("error dispatching manifest push to listener: %v", err) + context.GetLogger(ctx).Errorf("error dispatching manifest push to listener: %v", err) } }