cnaas-nms
cnaas-nms copied to clipboard
Rewrite log.py
PR for #237
move logging init into its own function. This has to be called for logging to work, but makes it possible for testing to just not call it and not require redis anymore. Other changes to logging: Instead of creating new loggers for each job, the same logger is used for all loggers (and also the flask logger is available separately). This logger changes format based on if it is a job thread or not, so the logging format should be the same as previously, but less loggers are used.
From Flask documentation, logger should preferably be initialized before app object is made, so i added a call to the init function in app.py.
Codecov Report
Base: 59.97% // Head: 59.73% // Decreases project coverage by -0.24%
:warning:
Coverage data is based on head (
0079e88
) compared to base (8482fa4
). Patch coverage: 47.82% of modified lines in pull request are covered.
:exclamation: Current head 0079e88 differs from pull request most recent head bfef395. Consider uploading reports for the commit bfef395 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## develop #238 +/- ##
===========================================
- Coverage 59.97% 59.73% -0.25%
===========================================
Files 62 62
Lines 6219 6221 +2
===========================================
- Hits 3730 3716 -14
- Misses 2489 2505 +16
Impacted Files | Coverage Δ | |
---|---|---|
src/cnaas_nms/tools/log.py | 58.33% <47.82%> (-41.67%) |
:arrow_down: |
src/cnaas_nms/tools/event.py | 78.57% <0.00%> (-7.15%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Some merge conflict appeared here, but probably very minor one?
SonarCloud Quality Gate failed.
0 Bugs
0 Vulnerabilities
1 Security Hotspot
0 Code Smells
No Coverage information
0.0% Duplication