-
Notifications
You must be signed in to change notification settings - Fork 67
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
Pcvl 769 logging user documentation #452
Pcvl 769 logging user documentation #452
Conversation
perceval/utils/logging/loggers.py
Outdated
@@ -123,6 +126,15 @@ def _configure_logger(self): | |||
exq_log.level.__members__[level], | |||
exq_log.channel.__members__[channel]) | |||
|
|||
def apply_config(self, config: LoggerConfig): | |||
if config.python_logger_is_enabled(): | |||
self = PythonLogger() |
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.
Could you test this thoroughly, please?
docs/source/reference/logging.rst
Outdated
- ``logger.warn`` | ||
- An indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘disk space low’). The software is still working as expected. | ||
* - ERROR | ||
- ``logger.error`` |
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.
It seems we called it "err" in exqalibur and not error :/
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.
Yes but the python logger module call it error. I think it's a good idea to keep the same interface :)
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 I meant is: we use exqalibur.logger.level
enum in Python, and exqalibur exposes the error level as exqalibur.logger.level.err
which is exposed by Python as perceval.utils.logging.level.err
So isn't there an issue with the doc?
docs/source/reference/logging.rst
Outdated
|
||
To log with Perceval you can either a built-in Perceval logger or the python one. By default, our logger will be used. | ||
|
||
To have the perceval message log with the python logger, use this method: |
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.
To log the Perceval message logs with the python logger, use this method:
(the word log gets too repetitive I understand but 'have' seemed weird to me, maybe 'save'?)
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.
No because saving it means save it in a file, which is a differant notion
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.
To log a message with the Python logger, use:
@@ -123,6 +126,13 @@ def _configure_logger(self): | |||
exq_log.level.__members__[level], | |||
exq_log.channel.__members__[channel]) | |||
|
|||
def apply_config(self, config: LoggerConfig): |
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.
To avoid the inability to change the logger type, from inside a given logger, you can define an apply_logger_config()
function outside of the logger classes. It would remove both user warnings.
docs/source/reference/logging.rst
Outdated
|
||
To log with Perceval you can either a built-in Perceval logger or the python one. By default, our logger will be used. | ||
|
||
To have the perceval message log with the python logger, use this method: |
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.
To log a message with the Python logger, use:
f956c39
to
2caba46
Compare
No description provided.