def logError(self, msg, end='\n', timestamp=True): """ Description An internal function to print error to stdout. Parameter msg: (str): The message to print. """ currentTime = self.getTime() if timestamp: msg = '\n{0}: Error: {1}'.format(currentTime, msg) else: # No timestamp and no newline are mainly for verifying states and status msg = '\nError: {0}'.format(msg) print('{0}'.format(msg), end=end) if self.generateLogFile: with open(self.restLogFile, 'a') as restLogFile: restLogFile.write('Error: '+msg+end) if self.robotFrameworkStdout: self.robotStdout.log_to_console(msg)