chiark / gitweb /
process putatives: Introduce dbg()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 24 Apr 2017 12:26:00 +0000 (13:26 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 24 Apr 2017 12:26:00 +0000 (13:26 +0100)
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotatlib/__init__.py

index 0f59f0d..9b2c33d 100644 (file)
@@ -390,16 +390,17 @@ def _cfg_process_putatives():
         server_pat + r' ' + '(?:' + client_pat + '|LIMIT)')
 
   for cs in cfg.sections():
-    log_debug_config('putatives: section [%s]...' % (cs))
+    def dbg(m):
+      log_debug_config('putatives: section [%s] %s' % (cs, m))
 
     def log_ignore(why):
-      log_debug_config('putatives: section [%s] X ignore: %s' % (cs, why))
+      dbg('X ignore: %s' % (why))
       print('warning: ignoring config section [%s] (%s)' % (cs, why),
             file=sys.stderr)
 
     if cs == 'LIMIT' or cs == 'COMMON':
       # plan A "[LIMIT]" or "[COMMON]"
-      log_debug_config('putatives: section [%s] A ignore' % (cs))
+      dbg('A ignore')
       continue
 
     try:
@@ -409,7 +410,7 @@ def _cfg_process_putatives():
 
       if server_re.fullmatch(cs):
         # plan C "[<servername>]"
-        log_debug_config('putatives: section [%s] C <server>' % (cs))
+        dbg('C <server>')
         putative(servers, cs, cs)
         continue
 
@@ -419,7 +420,7 @@ def _cfg_process_putatives():
 
         if pcs == 'LIMIT':
           # plan E "[<servername> LIMIT]"
-          log_debug_config('putatives: section [%s] E <server> LIMIT' % (cs))
+          dbg('E <server> LIMIT')
           continue
 
         try:
@@ -432,8 +433,7 @@ def _cfg_process_putatives():
 
         else: # no AddressValueError
           # plan D "[<servername> <client>]" part 3
-          log_debug_config('putatives: section [%s] D <server> <client>'
-                           % (cs))
+          dbg('D <server> <client>')
           putative(clients, ci, pcs)
           putative(servers, pss, pss)
           continue
@@ -443,7 +443,7 @@ def _cfg_process_putatives():
 
     else: # no AddressValueError
       # plan B "[<client>" part 2
-      log_debug_config('putatives: section [%s] B <client>' % (cs))
+      dbg('B <client>')
       putative(clients, ci, cs)
       continue