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

make default logger only print to stderr not file #847

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

hzxuzhonghu
Copy link
Member

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@hzxuzhonghu
Copy link
Member Author

Fix #835

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 52.77%. Comparing base (0956425) to head (fb8c42e).
Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
pkg/logger/logger.go 77.77% 2 Missing ⚠️
Files with missing lines Coverage Δ
pkg/auth/rbac.go 79.77% <ø> (ø)
pkg/bpf/bpf.go 41.81% <ø> (ø)
pkg/cache/v2/listener.go 49.33% <ø> (ø)
pkg/cache/v2/maps/listener.go 36.11% <ø> (ø)
pkg/cni/install.go 36.50% <ø> (ø)
pkg/cni/plugin/plugin.go 0.00% <ø> (ø)
pkg/controller/ads/ads_controller.go 93.33% <ø> (ø)
pkg/controller/bypass/bypass_controller.go 34.09% <ø> (ø)
pkg/controller/config/config.go 63.46% <ø> (ø)
pkg/controller/controller.go 0.00% <ø> (ø)
... and 9 more

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d83baf8...fb8c42e. Read the comment docs.

@@ -30,7 +30,7 @@ import (
)

var (
log = logger.NewLoggerField("pkg/telemetry")
log = logger.NewLoggerScope("pkg/telemetry")
Copy link
Collaborator

@LiZhenCheng9527 LiZhenCheng9527 Sep 12, 2024

Choose a reason for hiding this comment

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

nit:

Suggested change
log = logger.NewLoggerScope("pkg/telemetry")
log = logger.NewLoggerScope("telemetry")

or controller/telemetry

pkg/auth/rbac.go Outdated
@@ -47,7 +47,7 @@ const (
)

var (
log = logger.NewLoggerField("pkg/auth")
log = logger.NewLoggerScope("pkg/auth")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log = logger.NewLoggerScope("pkg/auth")
log = logger.NewLoggerScope("auth")

pkg as prefix doens't seem to make sense?

pkg/bpf/bpf.go Outdated
@@ -39,7 +39,7 @@ import (
)

var (
log = logger.NewLoggerField("pkg/bpf")
log = logger.NewLoggerScope("pkg/bpf")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log = logger.NewLoggerScope("pkg/bpf")
log = logger.NewLoggerScope("bpf")

ditto

Signed-off-by: Zhonghu Xu <[email protected]>
@Okabe-Rintarou-0
Copy link
Member

/lgtm

@nlgwcy
Copy link
Contributor

nlgwcy commented Sep 14, 2024

/lgtm
/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nlgwcy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@nlgwcy nlgwcy merged commit 53caaa8 into kmesh-net:main Sep 14, 2024
8 of 9 checks passed
@hzxuzhonghu hzxuzhonghu deleted the logger-improve branch September 14, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants