-
Notifications
You must be signed in to change notification settings - Fork 103
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 for testings log_file_level = DEBUG #2277
Conversation
@ReimarBauer Please tell if the changes are correct. |
@joernu76 Do you want debug loggings for the wms? |
For my problem this change did not help, because https://github.com/Open-MSS/MSS/blob/develop/pytest.ini#L6 |
Does this work? |
This looks fine! This is a humongous issue also with production servers. Could you leave our stuff on DEBUG, but set the matplotlib logger to info? That would be very, veeery helpful. |
Ok sure |
Kindly check if the changes are correct. @ReimarBauer @joernu76 |
pytest.ini
Outdated
@@ -3,7 +3,7 @@ log_cli = 1 | |||
log_cli_level = ERROR | |||
log_cli_format = %(message)s | |||
log_file = pytest.log | |||
log_file_level = DEBUG | |||
log_file_level = INFO |
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.
this should be kept DEBUG because pytest is only used for development.
When there are tests failing or the code has problems you usually want to show in pytest.log
and add debug messages.
Kindly check the changes @ReimarBauer |
mslib/mswms/wms.py
Outdated
@@ -146,7 +146,7 @@ def verify_pw(username, password): | |||
from mslib.utils.coordinate import get_projection_params | |||
|
|||
# Logging the Standard Output, which will be added to the Apache Log Files | |||
logging.basicConfig(level=logging.DEBUG, |
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.
keep in the whole MSS code the existing DEBUG.
On the server site a user has to use their own plot class, data classes to extend the existing. Usually that did not work on first attempt. They need these debug messages.
mslib/msui/mpl_map.py
Outdated
@@ -55,6 +55,8 @@ | |||
OPENAIP_NOTICE = "Airspace data used comes from openAIP.\n" \ | |||
"Visit openAIP.net and contribute to better aviation data, free for everyone to use and share." | |||
OURAIRPORTS_NOTICE = "Airports provided by OurAirports." | |||
mpl_logger = logging.getLogger('matplotlib') |
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.
changing the mpl_logger is the needed solution.
but we need our own debug messages in all mslib modules
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.
changing the mpl_logger is the needed solution.
but we need our own debug messages in all mslib modules
Will that be continued? |
Probably it cannot be done now. |
Will this work @ReimarBauer ? |
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.
this is a solution for python 2 which enables a user to redefine the states, maybe we can create later a follow up on this idea if it can be practicable used in py3
https://github.com/moinwiki/moin-1.9/tree/master/wiki/config/logging
https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig
the duplication of the lines may be improved
mslib/msidp/idp_conf.py
Outdated
@@ -183,17 +183,17 @@ def sso_dir_path(local_file): | |||
"stderr": { | |||
"class": "logging.StreamHandler", | |||
"stream": "ext://sys.stderr", | |||
"level": "DEBUG", | |||
"level": "INFO", |
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.
this was DEBUG
conftest.py
Outdated
@@ -38,6 +40,11 @@ | |||
from mslib.mswms.demodata import DataFiles | |||
import tests.constants as constants | |||
|
|||
matplotlib_logger = logging.getLogger('matplotlib') | |||
matplotlib_logger.setLevel(logging.INFO) | |||
mslib_logger = logging.getLogger('mslib') |
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.
this now changes any of our logging entries to debug. I think we should only change the 'matplotlib' logging
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.
limit the code repetition by importing that, see above
mslib/msui/mpl_qtwidget.py
Outdated
@@ -94,6 +94,11 @@ | |||
"plot_title_size": "default", | |||
"axes_label_size": "default"} | |||
|
|||
mpl_logger = logging.getLogger('matplotlib') |
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.
i would expect such blocks always after the import definition
and if it is always the same lines, can that become imported from an mslib.utils.loggerdef or other place?
mslib/utils/loggerdef.py
Outdated
@@ -0,0 +1,8 @@ | |||
# logging_config.py |
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.
please add the MSS header, see template
mslib/utils/loggerdef.py
Outdated
|
||
This file is part of MSS. | ||
|
||
:copyright: Copyright 2017 Main Contributor |
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.
What is your name @Preetam-Das26
and the year should be 2024, something like
:copyright: Copyright 2024 Preetam-Das26
mslib/utils/loggerdef.py
Outdated
This file is part of MSS. | ||
|
||
:copyright: Copyright 2017 Main Contributor | ||
:copyright: Copyright 2016-2023 by the MSS team, see AUTHORS. |
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.
fix the year too
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.
Thx
Purpose of PR?:
Fixes #2221
Does this PR introduce a breaking change?
If the changes in this PR are manually verified, list down the scenarios covered::
Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes
Checklist:
<type>: <subject>