REF: Remove LoggingExtras and use a package-local logger instead of global#490
Open
odow wants to merge 2 commits intolanl-ansi:mainfrom
Open
REF: Remove LoggingExtras and use a package-local logger instead of global#490odow wants to merge 2 commits intolanl-ansi:mainfrom
odow wants to merge 2 commits intolanl-ansi:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #490 +/- ##
==========================================
+ Coverage 74.09% 74.22% +0.12%
==========================================
Files 73 73
Lines 16404 16425 +21
==========================================
+ Hits 12155 12191 +36
+ Misses 4249 4234 -15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am migrating the InfrastructureModels ecosystem away from Memento.jl.
See lanl-ansi/InfrastructureModels.jl#99
PMD made this change a number of years ago. Your current design has a number of unforeseen consequences.
There are two main issues. The first is that this function mutates global state. If someone changes the logger after PMD, this function will erase their changes back to the global state before PMD.
PowerModelsDistribution.jl/src/core/logging.jl
Lines 53 to 54 in 79874bc
The other issue (or feature, depending on how you see it) is that every log must go through the PMD logger, even if they're completely unrelated.
PowerModelsDistribution.jl/src/core/logging.jl
Lines 78 to 82 in 79874bc
These aren't the end of the world (it's only logging), so merging this PR isn't strictly necessary. I mainly made this PR as an exercise to check that our logging strategy also works for PMD.
test_log
There's one issue with my design:
@test_logsworks by replacing the global logger with something that caches the logs so it can parse them for the messages. Since we have a package-specific logger we need our own version of_test_logs.