Skip to content

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

Closed

Conversation

expobrain
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Jan 10, 2017

Current coverage is 94.50% (diff: 100%)

Merging #572 into master will increase coverage by <.01%

@@             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          

Powered by Codecov. Last update f2ad9a2...478334e

@Byron
Copy link
Member

Byron commented Jan 15, 2017

@expobrain Is this PR linked to some issue I am unaware of? If not, could you explain its motivation? Thank you.

@expobrain
Copy link
Author

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.

@expobrain expobrain closed this Jan 16, 2017
@expobrain expobrain reopened this Jan 16, 2017
@expobrain
Copy link
Author

Sorry, closed the PR by mistake

try: # Python 2.7+
import logging.NullHandler
except ImportError:
class NullHandler(logging.Handler):
Copy link
Member

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.

Copy link
Author

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.

@Byron
Copy link
Member

Byron commented Jan 21, 2017

@expobrain Sorry for being so very delayed in my replies. I left a comment, but once clarified, it should be fine to merge.

@Byron
Copy link
Member

Byron commented Feb 25, 2017

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 info-level logging to the implementation of the parser.
The way clients are expected to work with that, should they need logging of the received line, is to pass an implementation of the RemoteProgress type. There one could override _parse_progress_line and log it, for example.

@Byron Byron closed this Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants