From c47914485e4eca6e1dda6f9702fda49e65ef750c Mon Sep 17 00:00:00 2001 From: Will Holland Date: Wed, 23 Sep 2015 09:45:20 +0100 Subject: Fix having added the wrong directory --- ciatlib/common.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ciatlib/common.py (limited to 'ciatlib/common.py') diff --git a/ciatlib/common.py b/ciatlib/common.py new file mode 100644 index 0000000..7a70a8b --- /dev/null +++ b/ciatlib/common.py @@ -0,0 +1,10 @@ +def log(logfile,component,msg): + ''' write message to log file with timestamp and script name ''' + import datetime + _component = str(component) + _msg = str(msg) + dt = str(datetime.datetime.now()).split('.')[0] + to_log = "[%s][%s] %s" % (dt, _component, _msg) + log_file = open(LOGFILE,'a') + log_file.write('%s\n' % to_log) + log_file.close() -- cgit v1.2.1