Skip to content

Commit f3700ab

Browse files
Merge pull request #67 from seibert-media/automatix-staring-time
Print start time at the beginning
2 parents 5a49ffa + 9c25bc6 commit f3700ab

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎automatix/__init__.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from copy import deepcopy
99
from csv import DictReader
1010
from tempfile import TemporaryDirectory
11-
from time import time
11+
from time import time, gmtime, strftime
1212
from typing import List
1313

1414
from .automatix import Automatix
@@ -32,18 +32,22 @@ def check_for_original_automatix():
3232
' THEN reinstall the package you want to use!')
3333

3434

35-
def setup(args: Namespace):
35+
def setup(args: Namespace) -> float:
3636
"""Setup logger and print version information"""
3737
init_logger(name=CONFIG['logger'], debug=args.debug)
38+
starttime = time()
3839

3940
LOG.info(f'Automatix Version {VERSION}')
41+
LOG.info(f'Started at: {strftime("%a, %d %b %Y %H:%M:%S UTC", gmtime(starttime))}')
4042

4143
configfile = CONFIG.get('config_file')
4244
if configfile:
4345
LOG.info(f'Using configuration from: {configfile}')
4446
else:
4547
LOG.warning('Configuration file not found or not configured. Using defaults.')
4648

49+
return starttime
50+
4751

4852
def get_script_and_batch_items(args: Namespace) -> (dict, list):
4953
script = get_script(args=args)
@@ -176,9 +180,8 @@ def main():
176180
if answer != 'yes':
177181
sys.exit(0)
178182

179-
starttime = time()
180183
args = arguments()
181-
setup(args=args)
184+
starttime = setup(args=args)
182185

183186
script, batch_items = get_script_and_batch_items(args=args)
184187

0 commit comments

Comments
 (0)