Procházet zdrojové kódy

add some client-side logging.

Jelmer Vernooij před 4 roky
rodič
revize
77c84b0008
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      dulwich/client.py

+ 7 - 0
dulwich/client.py

@@ -40,6 +40,7 @@ Known capabilities that are not supported:
 
 from contextlib import closing
 from io import BytesIO, BufferedReader
+import logging
 import os
 import select
 import socket
@@ -111,6 +112,9 @@ from dulwich.refs import (
 )
 
 
+logger = logging.getLogger(__name__)
+
+
 class InvalidWants(Exception):
     """Invalid wants."""
 
@@ -626,6 +630,9 @@ class GitClient(object):
                 )
 
             if old_sha1 != new_sha1:
+                logger.debug(
+                    'Sending updated ref %r: %r -> %r',
+                    refname, old_sha1, new_sha1)
                 if sent_capabilities:
                     proto.write_pkt_line(old_sha1 + b" " + new_sha1 + b" " + refname)
                 else: