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

Log more when resolving Python #4185

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

Maista6969
Copy link
Contributor

It's very common for users to struggle with configuring their Python environment for use with Stash and more verbose logging will help us when diagnosing the common issue of not knowing which (if any) Python executable they are using.

I also think the Resolve method could use the result of LookPath directly to use the absolute path for the Python executables it might find: this should make no difference to its usage, but allows us to log the absolute path.

@Maista6969 Maista6969 marked this pull request as draft October 9, 2023 02:46
Users often have problems configuring their Python installations
Adds additional logging to plugin tasks to
align with the logging that scrapers output.
@Maista6969 Maista6969 force-pushed the better-python-errmsg branch from 8b38b16 to 109202e Compare October 13, 2023 03:15
@Maista6969 Maista6969 marked this pull request as ready for review October 13, 2023 03:36
@WithoutPants WithoutPants added this to the Version 0.24.0 milestone Oct 16, 2023
Comment on lines 91 to 87
logger.Debugf("Scraper script <%s> started", strings.Join(cmd.Args, " "))
logger.Infof("Scraper script <%s> started", strings.Join(cmd.Args, " "))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing the level or logging that the scraper script is running? This was mostly for the support cases were we get "ran the scraper, nothing in the log" and I think it'd be helpful to at least see that Stash ran the scraper successfully even if it didn't produce correct output. We always ask users to turn their logging level to Debug and then there's usually some output 🙂

Comment on lines 119 to 115
logger.Debugf("Scraper script finished")
logger.Infof("Scraper script finished")
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above.

@WithoutPants WithoutPants added the improvement Something needed tweaking. label Nov 21, 2023
@WithoutPants WithoutPants merged commit 0dcd587 into stashapp:develop Nov 21, 2023
2 checks passed
@Maista6969 Maista6969 deleted the better-python-errmsg branch November 21, 2023 23:11
halkeye pushed a commit to halkeye/stash that referenced this pull request Sep 1, 2024
* Log more when resolving Python

Users often have problems configuring their Python installations

* Convert if-else ladder to switch statement
* Consolidate Python resolution

Adds additional logging to plugin tasks to
align with the logging that scrapers output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something needed tweaking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants