From f5dee9527caefac750ad1444ee93545690645ecd Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Fri, 20 Oct 2017 09:59:30 +0200 Subject: [PATCH] Closedown --- script/local.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/script/local.py b/script/local.py index fcbb3ed..651c724 100644 --- a/script/local.py +++ b/script/local.py @@ -65,15 +65,17 @@ class TestingTool: return self.testPath - def log(self, text): + def log(self, text, severity=0): """ Print/log information text = the string to be printed/logged + severity = 0:Info 1:Warning 2:Error """ import time time.ctime() now = time.strftime('%Y.%m.%d %H:%M:%S') - logText = self.deviceName + ' - ' + self.testName + ': ' + str(text) + sev = ['INFO','WARN','ERRO'] + logText = sev[severity] + ' - ' + self.deviceName + ' - ' + self.testName + ': ' + str(text) print now + ' ' + logText try: log(logText) @@ -116,7 +118,7 @@ class TestingTool: if testPassed: self.log('**** TEST PASSED ****') else: - self.log('**** TEST FAILED ****') + self.log('**** TEST FAILED ****',2) if returnString != '': self.log(returnString) ret = [self.testPath, self.deviceName, returnString, testPassed]