summaryrefslogtreecommitdiff
path: root/ciatlib/common.py
diff options
context:
space:
mode:
authorWill Holland <william.holland@codethink.co.uk>2015-09-23 09:45:20 +0100
committerWill Holland <william.holland@codethink.co.uk>2015-09-23 09:45:20 +0100
commitc47914485e4eca6e1dda6f9702fda49e65ef750c (patch)
tree1b76c8725b4021a3cdcc5489a3877b9fb3d3e293 /ciatlib/common.py
parent75303a157c460c98dd0fe66c9a1bf315c9ffb45c (diff)
downloadciatlib-c47914485e4eca6e1dda6f9702fda49e65ef750c.tar.gz
Fix having added the wrong directory
Diffstat (limited to 'ciatlib/common.py')
-rw-r--r--ciatlib/common.py10
1 files changed, 10 insertions, 0 deletions
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()