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

Print and log before the universe finishes running? #17

Closed
yyyliu opened this issue Jun 27, 2020 · 4 comments · Fixed by #18
Closed

Print and log before the universe finishes running? #17

yyyliu opened this issue Jun 27, 2020 · 4 comments · Fixed by #18
Assignees

Comments

@yyyliu
Copy link
Member

yyyliu commented Jun 27, 2020

Currently, a universe will log/print stdout and stderr after it finishes running. Is it possible to log/print these outputs more frequently? Individual scripts can take a long time to run and it will be helpful to track its progress via these outputs (e.g. such a script may periodically print its progress, but we could not view the progress in "real-time" now).

@AmethystGear
Copy link
Collaborator

AmethystGear commented Jun 27, 2020

I think we can, but I have a few questions:
Can we create two files, one for stdout and one for stderr in the boba logs?
i.e. for each log we have a folder "log_x", and inside that folder we have stdout.txt and stderr.txt
That would make periodic logging easier, since then stderr doesn't have to wait for stdout to finish before we can start printing it.

Second, what should be the print behavior for multiprocessing?
if we allow printing in the middle of the process we might have something like this happen if we're running multiple jobs at once:

job 1 says hello
job 2 says hello
job 1 says goodbye
job 2 says goodbye

so the printing would be mixed between different running processes. There's no problem with continuous logging since we're logging to different files, but should we disable continuous printing if there are multiple processes running?

@yyyliu
Copy link
Member Author

yyyliu commented Jun 28, 2020

Good questions :)

  • Having two files per universe is perfectly fine. Perhaps we could name stdout as log_x and stderr as error_x, so all logs can still be in the same folder. Maybe we can skip error_x if there is no error.
  • Interleaving outputs is not ideal, but it is fine unless we have a better solution ... Is it possible to append something like [universe x] before each line/snippet of the output? If not, maybe we could stick with what we have now, except that we can print something like universe x has started at the beginning so users can get some immediate feedback.

@AmethystGear
Copy link
Collaborator

Yes, we can print [universe_x] before each line to tell the user where that line is coming from. I'll make a PR implementing this soon.

@yyyliu
Copy link
Member Author

yyyliu commented Jun 28, 2020

Great, thanks!

AmethystGear added a commit that referenced this issue Jun 28, 2020
@AmethystGear AmethystGear mentioned this issue Jun 28, 2020
yyyliu pushed a commit that referenced this issue Jun 28, 2020
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

Successfully merging a pull request may close this issue.

2 participants