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
added logging sub-module #1155
added logging sub-module #1155
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #1155 +/- ##
==========================================
+ Coverage 89.32% 89.80% +0.48%
==========================================
Files 25 26 +1
Lines 1658 1707 +49
Branches 275 283 +8
==========================================
+ Hits 1481 1533 +52
+ Misses 131 128 -3
Partials 46 46 |
72b8be1
to
c24dab3
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.
this is great. Perhaps should be in tqdm.contrib.logging
or even just tqdm.contrib.__init__
for now?
https://github.com/tqdm/tqdm/#redirecting-writing still uses tqdm.contrib
for the stdout/err
redirection.
I moved it to |
7742d89
to
4125dcc
Compare
added logging sub-module python 2 compatibility fixed python 2 fix added test for custom tqdm class python 2 absolute imports (due to otherwise conflicting `logging` module) isort more tests relating to _get_first_found_console_formatter isort minor simplification test handleError test logging formatter being used minor rename to _get_first_found_console_logging_formatter test that certain exceptions are not swallowed avoid using mock.assert_called (py 3.5) moved to tqdm.contrib.logging added "Redirecting console logging to tqdm" readme removed no longer necessary absolute_import declaration minor: updated package of example in docstring
4125dcc
to
7458666
Compare
fixes #786 |
Hah @cthoyt it's a well overdue implementation of #786 - just never had enough free time to action it sooner; sorry. Full credit to @de-code though for one of the cleanest code PRs I've seen on this site.
It may look like I modded a lot but most of that was documentation, not code. |
this implements a slightly improved version of #786
The solution mainly differs from the one outlined in #786 in the following ways:
loggers
can be specified (still optional, and probably not needed most of the time)tqdm
class can be passed in