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

Rewrite log.py #238

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Rewrite log.py #238

wants to merge 2 commits into from

Conversation

stveit
Copy link
Contributor

@stveit stveit commented Dec 1, 2021

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.

move logging init into its own function. Change how get_logger works.
Logging now uses one logger (in additon to flask logger)
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Base: 59.97% // Head: 59.73% // Decreases project coverage by -0.24% ⚠️

Coverage data is based on head (0079e88) compared to base (8482fa4).
Patch coverage: 47.82% of modified lines in pull request are covered.

❗ 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%) ⬇️
src/cnaas_nms/tools/event.py 78.57% <0.00%> (-7.15%) ⬇️

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

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stveit stveit marked this pull request as ready for review September 21, 2022 17:38
@indy-independence
Copy link
Member

Some merge conflict appeared here, but probably very minor one?

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

2 participants