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

use bklog instead of logrus #4198

Merged
merged 2 commits into from
Sep 6, 2023
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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ linters-settings:
forbidigo:
forbid:
- '^fmt\.Errorf(# use errors\.Errorf instead)?$'
- 'logrus\.(Trace|Debug|Info|Warn|Warning|Error|Fatal)(f|ln)?\((# use bklog\.G\(ctx\) instead of logrus directly)?'
- '^logrus\.(Trace|Debug|Info|Warn|Warning|Error|Fatal)(f|ln)?(# use bklog\.G or bklog\.L instead of logrus directly)?$'
importas:
alias:
- pkg: "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
4 changes: 2 additions & 2 deletions cmd/buildkitd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func main() {
// Stop if we are registering or unregistering against Windows SCM.
stop, err := registerUnregisterService(cfg.Root)
if err != nil {
logrus.Fatal(err)
bklog.L.Fatal(err)
}
if stop {
return nil
Expand Down Expand Up @@ -332,7 +332,7 @@ func main() {

// Launch as a Windows Service if necessary
if err := launchService(server); err != nil {
logrus.Fatal(err)
bklog.L.Fatal(err)
}

errCh := make(chan error, 1)
Expand Down
6 changes: 3 additions & 3 deletions executor/resources/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"time"

"github.com/moby/buildkit/executor/resources/types"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/network"
"github.com/prometheus/procfs"
"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -229,7 +229,7 @@ func NewMonitor() (*Monitor, error) {
return
}
if err := prepareCgroupControllers(); err != nil {
logrus.Warnf("failed to prepare cgroup controllers: %+v", err)
bklog.L.Warnf("failed to prepare cgroup controllers: %+v", err)
}
})

Expand Down Expand Up @@ -280,7 +280,7 @@ func prepareCgroupControllers() error {
}
if err := os.WriteFile(filepath.Join(defaultMountpoint, cgroupSubtreeFile), []byte("+"+c), 0); err != nil {
// ignore error
logrus.Warnf("failed to enable cgroup controller %q: %+v", c, err)
bklog.L.Warnf("failed to enable cgroup controller %q: %+v", c, err)
}
}
return nil
Expand Down