Run Windows training agent without console
This commit is contained in:
@@ -296,7 +296,11 @@ def log(path: Path, message: str) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
stamp = datetime.now().astimezone().isoformat(timespec="seconds")
|
||||
line = f"[{stamp}] {message}"
|
||||
print(line, flush=True)
|
||||
if sys.stdout is not None:
|
||||
try:
|
||||
print(line, flush=True)
|
||||
except OSError:
|
||||
pass
|
||||
with path.open("a", encoding="utf-8") as handle:
|
||||
handle.write(line + "\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user