From 87884b641296a98545c0acc53ef964d40d6e7f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 8 Sep 2017 10:19:13 +0200 Subject: [PATCH] Add timezone info into logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timestamps in the main log are currently printed in local time. This patch adds UTC offset to the top of the log so it's possible to find out exactly when events happen. Fixes: https://pagure.io/pungi/issue/710 Signed-off-by: Lubomír Sedlář --- bin/pungi-koji | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/pungi-koji b/bin/pungi-koji index e9987ca8..5475bf4d 100755 --- a/bin/pungi-koji +++ b/bin/pungi-koji @@ -11,6 +11,7 @@ import locale import datetime import getpass import socket +import time import pipes import json @@ -261,6 +262,9 @@ def run_compose(compose, create_latest_link=True, latest_link_status=None): compose.log_info("Working directory: %s" % os.getcwd()) compose.log_info("Command line: %s" % " ".join([pipes.quote(arg) for arg in sys.argv])) compose.log_info("Compose top directory: %s" % compose.topdir) + is_dst = time.daylight and time.localtime().tm_isdst > 0 + compose.log_info("Current timezone offset: %s" + % time.altzone if is_dst else time.timezone) compose.read_variants() # dump the config file