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

[Merged by Bors] - Remove global logger #4749

Closed
wants to merge 4 commits into from
Closed

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Jul 26, 2023

Motivation

Using a global logger makes testing harder and logging configuration more complicated. This PR removes most uses of the global logger to address this.

Changes

  • Instead of the global logger services now use their own logging instance, this should reduce the number of log lines produced by 0000.defaultLogger
  • There are still a few places where the global logger is used, primarily the common/types package where it cannot be replaced without some bigger changes. Issue for this: logging: remove global logger #4751

Test Plan

n/a

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed

DevOps Notes

  • This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
  • This PR does not affect public APIs
  • This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
  • This PR does not make changes to log messages (which monitoring infrastructure may rely on)

@fasmat fasmat self-assigned this Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #4749 (313d98d) into develop (a7e5aae) will decrease coverage by 0.3%.
Report is 6 commits behind head on develop.
The diff coverage is 68.0%.

@@            Coverage Diff            @@
##           develop   #4749     +/-   ##
=========================================
- Coverage     77.1%   76.9%   -0.3%     
=========================================
  Files          255     259      +4     
  Lines        28886   29306    +420     
=========================================
+ Hits         22284   22547    +263     
- Misses        5209    5332    +123     
- Partials      1393    1427     +34     
Files Changed Coverage Δ
datastore/store.go 69.9% <0.0%> (ø)
fetch/fetch.go 79.6% <0.0%> (ø)
hare/statustracker.go 82.7% <0.0%> (ø)
log/log.go 96.5% <ø> (+3.0%) ⬆️
signing/signer.go 70.0% <ø> (-2.2%) ⬇️
api/grpcserver/transaction_service.go 60.7% <40.0%> (+0.1%) ⬆️
api/grpcserver/globalstate_service.go 70.0% <53.8%> (+0.2%) ⬆️
api/grpcserver/mesh_service.go 78.6% <56.0%> (+<0.1%) ⬆️
api/grpcserver/node_service.go 67.9% <69.2%> (ø)
node/node.go 65.5% <75.0%> (ø)
... and 6 more

... and 18 files with indirect coverage changes

@fasmat
Copy link
Member Author

fasmat commented Jul 26, 2023

bors try

bors bot added a commit that referenced this pull request Jul 26, 2023
@bors
Copy link

bors bot commented Jul 26, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@fasmat fasmat mentioned this pull request Jul 27, 2023
3 tasks
api/grpcserver/grpc.go Outdated Show resolved Hide resolved
@fasmat fasmat requested a review from poszu August 1, 2023 09:22
@fasmat
Copy link
Member Author

fasmat commented Aug 1, 2023

bors merge

bors bot pushed a commit that referenced this pull request Aug 1, 2023
## Motivation
 Using a global logger makes testing harder and logging configuration more complicated. This PR removes most uses of the global logger to address this.

## Changes
- Instead of the global logger services now use their own logging instance, this should reduce the number of log lines produced by `0000.defaultLogger`
- There are still a few places where the global logger is used, primarily the `common/types` package where it cannot be replaced without some bigger changes. Issue for this: #4751

## Test Plan
n/a

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
@fasmat
Copy link
Member Author

fasmat commented Aug 1, 2023

bors merge

@bors
Copy link

bors bot commented Aug 1, 2023

Already running a review

@bors
Copy link

bors bot commented Aug 1, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title Remove global logger [Merged by Bors] - Remove global logger Aug 1, 2023
@bors bors bot closed this Aug 1, 2023
@bors bors bot deleted the remove-global-logger branch August 1, 2023 12:05
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