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

Skip Log File for Interactive Commands #1934

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Saartank
Copy link
Collaborator

This PR adds changes to skip the creation of a log file for certain interactive commands:

  • config
  • credentials
  • generate
  • namespace
  • object

These commands are designed to be interactive and should not create a log file as a side effect.

@Saartank Saartank added bug Something isn't working client Issue affecting the OSDF client labels Jan 23, 2025
@Saartank Saartank added this to the v7.13.0 milestone Jan 23, 2025
@Saartank Saartank linked an issue Jan 23, 2025 that may be closed by this pull request
Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just move the log file generation code to the InitServer routines?

We already have sorted all the sub-commands into InitClient and InitServer; it seems counter-productive to sort them a second time into "interactive" and "not interactive", especially as setting up the logging appears to be one of the last things done in InitConfig.

If you want to get fancy, you buffer all the log messages until the logging configuration is done (although you'd have to be careful to emit them in case of an error) -- but even just printing them to stdout for the duration between InitConfig and InitXYZ may suffice.

@Saartank
Copy link
Collaborator Author

Based on the discussion this morning, we would not like to make InitConfig more complex. A better way moving forward would be to create the log file in InitServer. However, to achieve this, we would have to buffer all the logs generated before InitServer is executed.

Another problem I see with this approach is determining what to do if a fatal error occurs before the log buffer is emptied. How do we decide if the log buffer should be written to a file? These questions would have to be thought about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client Issue affecting the OSDF client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pelican config commands has side effects
2 participants