[Piuparts-commits] [piuparts] 01/01: p-m: log connect/disconnect with timestamp

Holger Levsen holger at moszumanska.debian.org
Sat Feb 8 14:44:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 1b46b8909b8aa44e50b91dbc4ab3806ce56c3f10
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Feb 8 14:08:36 2014 +0100

    p-m: log connect/disconnect with timestamp
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog           | 2 ++
 piuparts-master-backend.py | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 50d80f8..6a4c85c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -44,6 +44,8 @@ piuparts (0.57) UNRELEASED; urgency=low
       failed. Used for dependency resolution.
     - No longer special-case packages as essential-required and test them like
       normal packages (no-op test plus adequate run).  (Closes: #735907)
+  * piuparts-master-backend.py:
+    - Improve master.log verbosity.
   * piuparts-report.py:
     - Mark essential-required as obsolete and hide it.
   * Add more piuparts exceptions.
diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index 293f7a1..cb7b677 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -58,6 +58,9 @@ def setup_logging(log_level, log_file_name):
     logger.addHandler(log_handler)
     logger.setLevel(log_level)
 
+def timestamp():
+    return time.strftime("[%Y-%m-%d %H:%M:%S]")
+
 
 class Config(piupartslib.conf.Config):
 
@@ -171,10 +174,10 @@ class Master(Protocol):
 
         self._section = section
 
-        logging.debug("switching logfile")
+        logging.debug(timestamp() + " switching logfile")
         logfile = config["log-file"] or os.path.join(section, "master.log")
         setup_logging(logging.DEBUG, logfile)
-        logging.debug("connected")
+        logging.debug(timestamp() + " connected")
 
         # start with a dummy _binary_db (without Packages file), sufficient
         # for submitting finished logs
@@ -372,7 +375,7 @@ def main():
     while m.do_transaction():
         pass
 
-    logging.debug("disconnected")
+    logging.debug(timestamp() + " disconnected")
 
 if __name__ == "__main__":
     main()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list