-
Notifications
You must be signed in to change notification settings - Fork 51
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
Use loguru #303
Use loguru #303
Conversation
@orbeckst Do you mind have a check to see if you are happy with the new logger? How it works with other section of your code. I'm working on the doc now, where I plan to add a new miscellaneous section to the top level doc and a second level logging. Then in other places, I will just refer to this section. |
Codecov Report
@@ Coverage Diff @@
## master #303 +/- ##
==========================================
- Coverage 98.75% 98.75% -0.01%
==========================================
Files 27 27
Lines 1773 1762 -11
Branches 388 388
==========================================
- Hits 1751 1740 -11
Misses 2 2
Partials 20 20
|
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.
minor comments, overall good
docs/miscellaneous/logging.rst
Outdated
======= | ||
|
||
In **alchemlyb**, we use :mod:`loguru` for logging. By default, the | ||
:mod:`loguru` will print the logging information into the `stderr`. |
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.
Can you link to sys.stderr
in the Python docs?
from loguru import logger | ||
logger.remove() | ||
|
||
Then add other custom sink :: |
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.
Link to a page that explains what the format does, filter etc — basically the docs for logger.add
src/alchemlyb/estimators/mbar_.py
Outdated
:func:`scipy.optimize.root`. | ||
|
||
verbose : bool, optional | ||
Set to ``True`` if verbose debug output from :mod:`pymbar` is desired. | ||
Output from alchemlyb is logged via :mod:`logging`. | ||
Output from alchemlyb is logged via :mod:`loguru`. |
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.
remove as no logging done here?
docs/miscellaneous.rst
Outdated
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Miscellaneous |
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'd remove the TOC caption — looks superfluous as it is repeated, see https://alchemlyb--303.org.readthedocs.build/en/303/miscellaneous.html
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.
Sorry, what do you mean by this? I could change the :maxdepth: 2
to 1, if Print to the stderr and Save to a file is superfluous?
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.
Oh, I see.
@orbeckst Thanks for the review. I have addressed the changes. |
ebf6b52
to
40c6611
Compare
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.
great, will just make a minor doc fix before merge
Switch to use loguru for logging
Fix #301