Skip to content

Reduced log level for non-error events in win32.py#1769

Merged
webknjaz merged 1 commit into
cherrypy:masterfrom
robinchow:master
Mar 28, 2019
Merged

Reduced log level for non-error events in win32.py#1769
webknjaz merged 1 commit into
cherrypy:masterfrom
robinchow:master

Conversation

@robinchow
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

  • bug fix
  • feature
  • docs update
  • tests/coverage improvement
  • refactoring
  • other

What is the related issue number (starting with #)
N/A

What is the current behavior? (You can also link to an open issue here)
In win32.py's ConsoleCtrlHandler, if start/stop is called multiple times, this is logged at the ERROR (40) level.

What is the new behavior (if this is a feature change)?
If start/stop is called multiple times, this is logged at the INFO (20) level.

Other information:
Since the code handles the situation well, and there are no side effects to multiple calls, we shouldn't pollute the logs with error level entries.

Also, because ConsoleCtrlHandler is extremely proactive at removing itself (when it captures Ctrl+C or equivalent), even before it attempts to stop the bus, it sometimes ends up that the handler's stop is called multiple times (directly, then via a 'stop' publish event) during normal operations. There's no inherent badness to this, so while it should be noted/logged, it should be logged at a much lower level.

Checklist:

  • I think the code is well written
  • I wrote good commit messages
  • I have squashed related commits together after the changes have been approved
  • Unit tests for the changes exist
  • Integration tests for the changes exist (if applicable)
  • I used the same coding conventions as the rest of the project
  • The new code doesn't generate linter offenses
  • Documentation reflects the changes
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences

@rtd-helper

This comment has been minimized.

@webknjaz webknjaz closed this Feb 15, 2019
@webknjaz webknjaz reopened this Feb 15, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 15, 2019

Codecov Report

Merging #1769 into master will decrease coverage by 0.02%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #1769      +/-   ##
==========================================
- Coverage   80.29%   80.26%   -0.03%     
==========================================
  Files         104      104              
  Lines       13642    13639       -3     
==========================================
- Hits        10954    10948       -6     
- Misses       2688     2691       +3

@robinchow
Copy link
Copy Markdown
Contributor Author

Hi, any update on this? Is there any additional work/discussion required?

@webknjaz
Copy link
Copy Markdown
Member

I've restarted tests, will merge after success

@robinchow
Copy link
Copy Markdown
Contributor Author

I scanned the failed builds, and I don't see anything that links the failed tests to this code change. I could be wrong though, happy to fix up someone points me in the general direction.

@webknjaz
Copy link
Copy Markdown
Member

Yeah, TravisCI build got fixed upon restart

@webknjaz webknjaz merged commit b648977 into cherrypy:master Mar 28, 2019
@webknjaz
Copy link
Copy Markdown
Member

Thanks!

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