Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush logs to disk as soon as possible #1040

Closed
nguyentanthong opened this issue May 31, 2024 · 2 comments
Closed

Flush logs to disk as soon as possible #1040

nguyentanthong opened this issue May 31, 2024 · 2 comments
Assignees

Comments

@nguyentanthong
Copy link

def log(self, name: str, data: Scalar, step: int) -> None:
self._file.write(f"Step {step} | {name}:{data}\n")
def log_dict(self, payload: Mapping[str, Scalar], step: int) -> None:
self._file.write(f"Step {step} | ")
for name, data in payload.items():
self._file.write(f"{name}:{data} ")
self._file.write("\n")

Current implementation does not flush the log to disk right away. It is better if we add

self._file.flush()

at the end of these logging methods.

@felipemello1 felipemello1 self-assigned this Jun 3, 2024
@felipemello1
Copy link
Contributor

felipemello1 commented Jun 4, 2024

hey @nguyentanthong , thanks for bringing this up! I will look at it this week. If you are interested in contributing, please feel free to submit PR + testing, describing the issue and your solution.

@ebsmothers
Copy link
Contributor

Resolved by #1078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants