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

flux_log() should do something sensible if flux_t argument is NULL #1191

Closed
garlick opened this issue Sep 14, 2017 · 0 comments
Closed

flux_log() should do something sensible if flux_t argument is NULL #1191

garlick opened this issue Sep 14, 2017 · 0 comments

Comments

@garlick
Copy link
Member

garlick commented Sep 14, 2017

As noted in #321, it would make sense for flux_log() to log to stderr if the flux_t argument is NULL.

One use case (unit testability of otherwise standalone code with flux_log() calls in it) is mentioned in #1190

We could simply log to stderr if the arg is NULL. For extra credit, turn level into a string and log that too. I think it's debatable whether we'd want to go further than that, e.g. add timestamp, use globals to store the "log context" (thereby allowing flux_log_set_appnum() and flux_log_set_procid() to work), etc.

chu11 added a commit to chu11/flux-core that referenced this issue Sep 14, 2017
Make flux handle optional in logging functions.  If flux handle
is NULL, output to stderr.

Add unit tests appropriately.

Fixes flux-framework#1191
chu11 added a commit to chu11/flux-core that referenced this issue Sep 15, 2017
Make flux handle optional in logging functions.  If flux handle
is NULL, output to stderr.

Update documentation and add unit tests appropriately.

Fixes flux-framework#1191
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

1 participant