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

Improve ipdevpoll logging of SQL queries and from Twisted library #2640

Merged
merged 2 commits into from Jun 14, 2023

Conversation

lunkwill42
Copy link
Member

In working on #1073, some needs for improved logging in ipdevpoll appeared. These were extracted as a separate PR to make for a smaller review :)

Trying to debug log the db module *without* getting drowned in generated
SQL queries is hard.  Making a sub-logger at least enables us to
deselect debug logging of queries wile debug logging everything else
from nav.ipdevpoll.db
The Twisted library doesn't use the regular Python logging framework.
However, a twisted log observer can be added to propagate twisted
log messages to the regular python logging framework, which is what the
rest of ipdevpoll process uses.
@lunkwill42 lunkwill42 self-assigned this Jun 1, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

Test results

     12 files       12 suites   12m 58s ⏱️
3 256 tests 3 160 ✔️   96 💤 0
9 243 runs  8 955 ✔️ 288 💤 0

Results for commit e8416e6.

♻️ This comment has been updated with latest results.

@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #2640 (e8416e6) into master (ec1c6b1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2640   +/-   ##
=======================================
  Coverage   54.61%   54.61%           
=======================================
  Files         560      560           
  Lines       40708    40712    +4     
=======================================
+ Hits        22231    22235    +4     
  Misses      18477    18477           
Impacted Files Coverage Δ
python/nav/ipdevpoll/daemon.py 55.42% <100.00%> (+0.54%) ⬆️
python/nav/ipdevpoll/db.py 84.90% <100.00%> (+0.29%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lunkwill42 lunkwill42 requested a review from hmpf June 5, 2023 09:52
Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

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

After manual testing I can say this works a intended.

The only improvement I have is that there is a typo in your first commit message ("wile" instead of "while")

@lunkwill42
Copy link
Member Author

The only improvement I have is that there is a typo in your first commit message ("wile" instead of "while")

Yeah, I think I'm going to let that one slip 😆

@lunkwill42 lunkwill42 merged commit cc6dc7a into Uninett:master Jun 14, 2023
13 checks passed
@lunkwill42 lunkwill42 deleted the feature/ipdevpoll-logging branch June 14, 2023 07:17
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.

None yet

2 participants