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

Fix Logger - ConfigManager circular reference #1054

Conversation

crschardt
Copy link
Contributor

This addresses a circular import between ConfigManager and Logger that was preventing some messages from being logged as PV was starting. Logger calls ConfigManager on initialization to get the path for the log file, but ConfigManager also creates and instance of Logger. Somehow, this all gets resolved, but it means that some of the log messages from SqlConfigProvider disappear.

The fix presented here is by creating a new class, PathManager, that Logger and ConfigManager both access to get the directory paths they need. Right now I've made the minimum changes to break the dependency. If this is the right way to go forward, we should move all the path-related methods from ConfigManager into PathManager so that there is a clean separation.

@crschardt crschardt requested a review from a team as a code owner December 17, 2023 18:53
@crschardt crschardt changed the title Fix logger config manager circular reference Fix Logger - ConfigManager circular reference Dec 17, 2023
@crschardt crschardt force-pushed the fix-Logger-ConfigManager-circular-reference branch from e81d5c6 to 5dc3a47 Compare December 17, 2023 19:22
@crschardt
Copy link
Contributor Author

Any idea why this failed on the fat Jar - Linux? It passed all the tests before master was merged.

@mcm001
Copy link
Contributor

mcm001 commented Dec 18, 2023

Looks good now

Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

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

Ship it

@mcm001 mcm001 merged commit 796b8e7 into PhotonVision:master Dec 18, 2023
23 checks passed
@crschardt crschardt deleted the fix-Logger-ConfigManager-circular-reference branch December 18, 2023 18:28
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.

2 participants