nicer logs
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 2 Oct 2018 19:34:10 +0000 (21:34 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 2 Oct 2018 19:36:15 +0000 (21:36 +0200)
sfa/trust/certificate.py
sfa/trust/gid.py
sfa/util/sfalogging.py

index 199504d..dfee4e8 100644 (file)
@@ -838,7 +838,6 @@ class Certificate:
         # the public key contained in it's parent. The chain is recursed
         # until a certificate is found that is signed by a trusted root.
 
-        logger.debug("Certificate.verify_chain {}".format(self.pretty_name()))
         # verify expiration time
         if self.x509.has_expired():
             if debug_verify_chain:
@@ -848,7 +847,8 @@ class Certificate:
 
         # if this cert is signed by a trusted_cert, then we are set
         for i, trusted_cert in enumerate(trusted_certs, 1):
-            logger.debug("Certificate.verify_chain - trying trusted #{} : {}"
+            logger.debug(5*'-' +
+                         " Certificate.verify_chain - trying trusted #{} : {}"
                          .format(i, trusted_cert.pretty_name()))
             if self.is_signed_by_cert(trusted_cert):
                 # verify expiration of trusted_cert ?
index 7222b18..799b1f4 100644 (file)
@@ -232,7 +232,9 @@ class GID(Certificate):
     # planetlab.us.arizona cannot sign a GID for planetlab.us.princeton.foo.
 
     def verify_chain(self, trusted_certs=None):
-        logger.debug("GID.verify_chain with {} trusted certs".format(len(trusted_certs)))
+        logger.debug(10*'=' + " GID.verify_chain with {} trusted certs"
+                     .format(len(trusted_certs)))
+        logger.debug("on {}".format(self.pretty_name()))
         # do the normal certificate verification stuff
         trusted_root = Certificate.verify_chain(self, trusted_certs)
 
index 5a9745c..80d8b3f 100644 (file)
@@ -123,7 +123,7 @@ def logging_config(context):
     if context == 'server':
         handlername = 'file'
         filename = '/var/log/sfa.log'
-        level = 'INFO'
+        level = 'DEBUG'
     elif context == 'import':
         handlername = 'file'
         filename = '/var/log/sfa-import.log'
@@ -168,7 +168,7 @@ def logging_config(context):
             'level': level,
             'formatter': 'standard',
             'class': 'logging.StreamHandler',
-            }
+        }
     else:
         config['handlers']['file'] = {
             'filename': filename,
@@ -179,7 +179,7 @@ def logging_config(context):
             'when': 'w0',
             'interval': 1,
             'backupCount': 12,
-            }
+        }
     return config