Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: corrent the import path of logrus #953

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions daemon/mgr/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/alibaba/pouch/pkg/meta"
"github.com/alibaba/pouch/pkg/randomid"

netlog "github.com/Sirupsen/logrus"
"github.com/docker/go-connections/nat"
"github.com/docker/libnetwork"
nwconfig "github.com/docker/libnetwork/config"
Expand Down Expand Up @@ -411,15 +410,15 @@ func (nm *NetworkManager) getNetworkSandbox(id string) libnetwork.Sandbox {

func initNetworkLog(cfg *config.Config) {
if cfg.Debug {
netlog.SetLevel(netlog.DebugLevel)
logrus.SetLevel(logrus.DebugLevel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Libnetwork's logrus version is different from pouchd, so we need to set libnetwork's logrus addintionly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

known

}

formatter := &netlog.TextFormatter{
formatter := &logrus.TextFormatter{
ForceColors: true,
FullTimestamp: true,
TimestampFormat: "2006-01-02 15:04:05.000000000",
}
netlog.SetFormatter(formatter)
logrus.SetFormatter(formatter)
}

func endpointOptions(n libnetwork.Network, nwconfig *apitypes.NetworkSettings, epConfig *apitypes.EndpointSettings) ([]libnetwork.EndpointOption, error) {
Expand Down
2 changes: 1 addition & 1 deletion network/mode/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (

"github.com/alibaba/pouch/apis/types"
"github.com/alibaba/pouch/daemon/mgr"
"github.com/alibaba/pouch/extra/libnetwork/Godeps/_workspace/src/github.com/Sirupsen/logrus"
"github.com/alibaba/pouch/network"
"github.com/alibaba/pouch/pkg/errtypes"

"github.com/docker/libnetwork/drivers/bridge"
"github.com/docker/libnetwork/netlabel"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/vishvananda/netlink"
)

Expand Down
2 changes: 1 addition & 1 deletion registry/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/alibaba/pouch/apis/types"

"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
)

// challengeClient defines a client to manage challenge–response authentication.
Expand Down
7 changes: 3 additions & 4 deletions volume/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"reflect"

"github.com/alibaba/pouch/extra/libnetwork/Godeps/_workspace/src/github.com/Sirupsen/logrus"
"github.com/alibaba/pouch/pkg/client"
metastore "github.com/alibaba/pouch/pkg/meta"
"github.com/alibaba/pouch/volume/driver"
Expand All @@ -13,7 +12,7 @@ import (
"github.com/alibaba/pouch/volume/types/meta"

"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
)

// Core represents volume core struct.
Expand Down Expand Up @@ -45,7 +44,7 @@ func NewCore(cfg Config) (*Core, error) {
},
})
if err != nil {
log.Errorf("failed to create volume meta store: %v", err)
logrus.Errorf("failed to create volume meta store: %v", err)
return nil, err
}

Expand Down Expand Up @@ -206,7 +205,7 @@ func (c *Core) ListVolumeName(labels map[string]string) ([]string, error) {
return nil, errors.Wrap(err, "List volume's name")
}

log.Debugf("List volume URL: %s, labels: %s", url, labels)
logrus.Debugf("List volume URL: %s, labels: %s", url, labels)

if err := client.New().ListKeys(url, &names); err != nil {
return nil, errors.Wrap(err, "List volume's name")
Expand Down