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

Allow specific log filenames to be supplied to ekat::logging::Logger #209

Open
jeff-cohere opened this issue Mar 25, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@jeff-cohere
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, all of the constructors for EKAT's Logger class append the MPI rank and _logfile.txt to the name provided. E3SM passes EAM a log file name to use for logging messages, so it would be nice to have a mechanism for specifying exactly that log file.

Describe the solution you'd like
Can we add a constructor to the Logger class that was able to accept a given log file name? I don't know how all of this fits in with MPI ranks and such. I think we should draw @AaronDonahue into this conversation.

@jeff-cohere jeff-cohere added the enhancement New feature or request label Mar 25, 2022
@jeff-cohere jeff-cohere changed the title Add additional constructor to ekat::Logger to allow explicitly-set filenames Allow specific log filenames to be supplied to ekat::logging::Logger Mar 25, 2022
@bartgol
Copy link
Contributor

bartgol commented Mar 28, 2022

I completely agree. Instead of adding _logfile.txt we could simply add .log, since that's a widely recognized extension for log files.

As for the MPI ranks, we can also provide an optional ctor arg, that tells whether we should add rank info in the log file.

@bartgol
Copy link
Contributor

bartgol commented Mar 28, 2022

Uhm, I am looking at the impl, and noticed that "rank0-only" is an optiion settable after construction. Considering that such action (namely, turning off logging for rank>0) cannot be undone, it could easily be done at construction time. Even better, we could encode it with an extra template argument (which, I think, was the original design).

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

2 participants