MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / stream_logs

Method stream_logs

battlecode-manager/player_plain.py:22–28  ·  view source on GitHub ↗
(self, stdout=True, stderr=True, line_action=lambda line: print(line.decode()))

Source from the content-addressed store, hash-verified

20 super().__init__(socket_file, working_dir, local_dir, None, None, player_key, player_mem_limit, player_cpu)
21
22 def stream_logs(self, stdout=True, stderr=True, line_action=lambda line: print(line.decode())):
23 assert not self.streaming
24 self.streaming = True
25 if stdout:
26 threading.Thread(target=self._stream_logs, args=(self.process.stdout, line_action), daemon=True).start()
27 if stderr:
28 threading.Thread(target=self._stream_logs, args=(self.process.stderr, line_action), daemon=True).start()
29
30 def _stream_logs(self, stream, line_action):
31 for line in stream:

Callers 1

run_gameFunction · 0.45

Calls 1

startMethod · 0.45

Tested by

no test coverage detected