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

add a -log-service cli flag #355

Merged
merged 1 commit into from
Sep 28, 2022
Merged

add a -log-service cli flag #355

merged 1 commit into from
Sep 28, 2022

Conversation

metachris
Copy link
Collaborator

📝 Summary

For production logs it's sometimes useful to add a dedicated service tag to distinguish services by their logs only. This PR adds a -log-service flag, which when given adds a service=... tag to each and ever log message.


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2022

Codecov Report

Merging #355 (f7487bb) into main (af2741f) will increase coverage by 1.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #355      +/-   ##
==========================================
+ Coverage   81.44%   82.47%   +1.03%     
==========================================
  Files           5        5              
  Lines         679      679              
==========================================
+ Hits          553      560       +7     
+ Misses         96       91       -5     
+ Partials       30       28       -2     
Flag Coverage Δ
unittests 82.47% <ø> (+1.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/service.go 80.98% <0.00%> (+1.72%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -90,6 +91,9 @@ func Main() {
}
logrus.SetLevel(lvl)
}
if *logService != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't the logger add service=mev-boost by default instead of explicitly adding via a flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, better to keep the default off, and only enable it if wanted by the user

@metachris metachris merged commit 4716f44 into main Sep 28, 2022
@metachris metachris deleted the log-service branch September 28, 2022 07:16
screwyprof pushed a commit to screwyprof/mev-boost that referenced this pull request Feb 3, 2023
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.

3 participants