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]