diff options
author | Will Holland <william.holland@codethink.co.uk> | 2015-09-23 09:45:20 +0100 |
---|---|---|
committer | Will Holland <william.holland@codethink.co.uk> | 2015-09-23 09:45:20 +0100 |
commit | c47914485e4eca6e1dda6f9702fda49e65ef750c (patch) | |
tree | 1b76c8725b4021a3cdcc5489a3877b9fb3d3e293 /ciatlib/common.py | |
parent | 75303a157c460c98dd0fe66c9a1bf315c9ffb45c (diff) | |
download | ciatlib-c47914485e4eca6e1dda6f9702fda49e65ef750c.tar.gz |
Fix having added the wrong directory
Diffstat (limited to 'ciatlib/common.py')
-rw-r--r-- | ciatlib/common.py | 10 |
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() |