-
-
Notifications
You must be signed in to change notification settings - Fork 937
Log lines for debugging #572
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
Conversation
Current coverage is 94.50% (diff: 100%)@@ master #572 diff @@
==========================================
Files 63 63
Lines 9932 9941 +9
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 9386 9395 +9
Misses 546 546
Partials 0 0
|
1f2d7b6
to
287bd9e
Compare
287bd9e
to
f3693db
Compare
@expobrain Is this PR linked to some issue I am unaware of? If not, could you explain its motivation? Thank you. |
Hi @Byron, this PR allows to see not only the git-push/git-fetch command but also the output of it. It's useful i.e. in case a git hook rejects the commit and you want to see the message in the logs. |
Sorry, closed the PR by mistake |
try: # Python 2.7+ | ||
import logging.NullHandler | ||
except ImportError: | ||
class NullHandler(logging.Handler): |
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 don't understand what the NullHandler is used for. So far it was sufficient to obtain a logging using logging.getLogger('git.util')
and assume parties interested in logging have set it up to contain/inherit handlers.
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 juts following the same pattern of enable logging like it is done in other part of GitPython
as well (see git/cmd.py
for example). The only difference is that unit tests under Python 2.6+ are failing because the logging
package in 2.6 doesn't have the NullHandler
thus this little piece of code.
@expobrain Sorry for being so very delayed in my replies. I left a comment, but once clarified, it should be fine to merge. |
Sorry for the great delay, and for the hold-up due to this Nullhandler. Now that it is clarified I realize this PR should not be merged, as it adds |
No description provided.