-
Notifications
You must be signed in to change notification settings - Fork 28
Possible logging simplification #515
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
Possible logging simplification #515
Conversation
Codecov Report
@@ Coverage Diff @@
## master #515 +/- ##
==========================================
- Coverage 94.12% 94.07% -0.05%
==========================================
Files 44 44
Lines 2742 2736 -6
Branches 392 392
==========================================
- Hits 2581 2574 -7
Misses 122 122
- Partials 39 40 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
430a7aa to
1706717
Compare
|
I think the change you suggest is fine, and a great solution to the problem of having to add a line in every module. I will let Marco comment on it. |
|
Thanks, @goodenou. |
|
I like the idea to use self and reduce the boilerplate. Anyway, if the module name is preferable, it is possible to get that one as well: |
1706717 to
6b7178b
Compare
|
Class name seems a bit better to me. |
|
Thanks, @goodenou--the current PR uses |
|
@knoepfel Will you also please remove the following lines from the LogicEngine.py module: from decisionengine.framework.modules.logging_configDict import CHANNELLOGGERNAME It inherits from the Module class and doesn't need these definitions. |
6b7178b to
2fbf2af
Compare
2fbf2af to
39f7430
Compare
|
Good catch, Lisa. Fixed. |
BrunoCoimbra
left a comment
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.
The motivation for this is that in every module that wants to use framework-supported logging, that module must provide the following boilerplate in the module constructor
This PR removes this boilerplate by adding the following in only the framework's
Moduleconstructor:In many cases, the name of the Python module and the name of the class are the same, so this would not change those cases. This works because the
selfargument is the type of the most derived class that invokessuper().__init__(...)in its own module constructor.Question: Is this simplification desired despite the slight change in behavior?