From e56eb4a29b940a18b3bb5e2890c9db57024bec7f Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 13 Jul 2015 11:37:38 +0000 Subject: reproducible: _common.py: print starting, ending and execution time --- bin/reproducible_common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index c3388bef..7b3ed417 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -14,6 +14,7 @@ import re import sys import json import errno +import atexit import sqlite3 import logging import argparse @@ -83,6 +84,8 @@ sh = logging.StreamHandler() sh.setFormatter(logging.Formatter('%(levelname)s: %(message)s')) log.addHandler(sh) +started_at = datetime.now() +log.info('Starting at %s', started_at) log.debug("BIN_PATH:\t" + BIN_PATH) log.debug("BASE:\t\t" + BASE) @@ -219,6 +222,12 @@ for issue in filtered_issues: filter_html += ' or ' + issue + '' +@atexit.register +def print_time(): + log.info('Finished at %s, took: %s', datetime.now(), + datetime.now()-started_at) + + def print_critical_message(msg): print('\n\n\n') try: -- cgit v1.2.3-54-g00ecf