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

Initialize log and config files right after parsing arguments #7585

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

alevinval
Copy link
Contributor

Either after parsing arguments or before running the --health logic, since that one already requires access to the config dir. I'd say it's better to play it safe and put it right after parsing arguments.

helix_loader::initialize_config_file(args.config_file.clone());
helix_loader::initialize_log_file(args.log_file.clone());

setup_logging(args.verbosity).context("failed to initialize logging")?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically it could be moved right before --health, I can do that. In terms of future-proofing, I think doing it as soon as possible is best.

Copy link
Contributor Author

@alevinval alevinval Jul 9, 2023

Choose a reason for hiding this comment

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

I see that fetch/build grammars and health do not use logging, but I still moved setup_logging to the top. I can leave it where it was if you disagree. That's probably overkill, leaving it where it was.

@the-mikedavis the-mikedavis linked an issue Jul 9, 2023 that may be closed by this pull request
@the-mikedavis the-mikedavis changed the title fix: initialisation should happen right after parsing arguments Initialize log and config files right after parsing arguments Jul 9, 2023
@the-mikedavis the-mikedavis merged commit 28452e1 into helix-editor:master Jul 9, 2023
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 this pull request may close these issues.

hx panics using the command "hx --health" on a fresh install
3 participants