def _log_stop(self, why): info = { 'type': 'done', 'error': str(why) if why else '', 'end_time': now(), } self._dump(info)
def _log_start(self, space, env, test): info = { 'type': 'start', 'start_time': now(), 'workspace': space.workdir, 'log_path': space.logdir, 'total_cases': test.count, 'env': self._collect_env(env), 'deps': env.query_dependencies(), } self._dump(info)
def log(self, data): msg = '|'.join([now(), json.dumps(data)]) + os.linesep with open(self.fname, 'a') as fp: fp.write(msg)
def log(self, msg, level="INFO"): self.logfile.write('%s %s: %s\n' % (now(), level, msg))
def _dump(self, data): msg = '|'.join([now(), json.dumps(data)]) + os.linesep with open(self.status_path, 'a') as f: f.write(msg)