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

Per-process logging #204

Open
johnomotani opened this issue Apr 15, 2024 · 0 comments
Open

Per-process logging #204

johnomotani opened this issue Apr 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@johnomotani
Copy link
Collaborator

It would be nice to write printed messages to log files as well as the terminal. If we have 1 log file for each process, we can see which process each message actually came from, which could be useful for debugging, etc.

One option could be to use the Logging module (https://docs.julialang.org/en/v1/stdlib/Logging/) and define a 'custom logger' that prints the message both to stdout and to a file (that can be named when the logger is created). We'd replace println(foo) with @info foo (or possibly @warn foo or @debug foo...).

It should also be possible to have messages that are printed to the log files by all processes, but only printed to the terminal by the root (MPI rank-0) process, either as the default setting (the custom Logger could check whether it is on rank-0 or not), or with a custom macro like @info_root which we could copy/modify from @info.

@johnomotani johnomotani added the enhancement New feature or request label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant