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

fix: Refactor logger initialization in example_test.go #580

Merged
merged 1 commit into from
May 15, 2023

Conversation

aimuz
Copy link
Contributor

@aimuz aimuz commented May 11, 2023

This commit refactors the logger initialization in the example_test.go files for the logr, logrus, and zap interceptors. In each file, the InterceptorLogger function was modified to create a new logger instance using the original logger and additional fields passed in as arguments, rather than modifying the original logger instance. This ensures that subsequent logs using the original logger are not affected by the additional fields.

The changes were made to the following files:

  • interceptors/logging/examples/logr/example_test.go
  • interceptors/logging/examples/logrus/example_test.go
  • interceptors/logging/examples/zap/example_test.go
  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

@aimuz aimuz changed the base branch from v2 to main May 12, 2023 02:50
@johanbrandhorst
Copy link
Collaborator

Please rebase, a fix for one of these files was just merged

This commit refactors the logger initialization in the example_test.go files
for the logr, logrus, and zap interceptors. In each file, the InterceptorLogger
function was modified to create a new logger instance using the original logger
and additional fields passed in as arguments, rather than modifying the original
logger instance. This ensures that subsequent logs using the original logger are not
affected by the additional fields.

The changes were made to the following files:
- interceptors/logging/examples/logr/example_test.go
- interceptors/logging/examples/logrus/example_test.go
- interceptors/logging/examples/zap/example_test.go

Signed-off-by: aimuz <mr.imuz@gmail.com>
@aimuz
Copy link
Contributor Author

aimuz commented May 15, 2023

rebase done

@johanbrandhorst johanbrandhorst merged commit a18e1e2 into grpc-ecosystem:main May 15, 2023
6 checks passed
@johanbrandhorst
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants