-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: Enshrine defra logger names #1410
chore: Enshrine defra logger names #1410
Conversation
e0f47be
to
388155b
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1410 +/- ##
===========================================
- Coverage 72.19% 72.18% -0.02%
===========================================
Files 185 185
Lines 18239 18239
===========================================
- Hits 13168 13165 -3
- Misses 4031 4033 +2
- Partials 1040 1041 +1
|
388155b
to
78c2792
Compare
Note that there is another approach to this which is to keep the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving the code changes, but am unsure as to whether this is a good feature change long-term.
I can see the defra
prefix as being quite handy when embedding defra. I do think explicilty hardcoding the namespaces for every logger instance is quite bad anyway though, and we should probably switch the constructor to some kind of parent-child like mechanic where the namespace is constructed without redefining the strings on every instance - is a problem for another day though, and the code changes here facilitate that somewhat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Andy that the prefix is really useful in future when defradb is embedded or used by another tool, to differentiate between defradb logs and other logs for example.
Would make a ticket for automagically handling that through the logger constructor if it won't be done in this PR.
I don't plan to work on that additional idea. In my view, distinguishing between Defra logs and non-Defra logs is done at a higher level or "the process level", i.e not internal to Defra. |
That said, it is a good idea to figure out how Defra logging can play nice in the embedding case |
## Relevant issue(s) Resolves sourcenetwork#1148 ## Description Simple approach: just rename the loggers. ## How has this been tested? CI & manual
Relevant issue(s)
Resolves #1148
Description
Simple approach: just rename the loggers.
Suggestion: non-defra loggers could have a prefix like e.g.
x.
Tasks
How has this been tested?
CI