-
Notifications
You must be signed in to change notification settings - Fork 632
[CO-357] Re-emit: Fix 'overrideConsoleLog' #3639
Conversation
lib/src/Pos/Launcher/Resource.hs
Outdated
-- add output to the console with severity filter >= Info | ||
Just False -> identity | ||
Just False -> src <> disabledConsoleConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disabledConsoleConfiguration
should be a filter on the incoming LoggerConfig and remove all backends that write to the console.
-- | Handler to override another console 'LogHandler' and disable logging | ||
-- to console altogether. | ||
disabledConsoleConfiguration :: LoggerConfig | ||
disabledConsoleConfiguration = LoggerConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just adds a 'no-op'; I don't think this was the intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this will collapse with other LoggerConfig
called "console". I thought that's how logging to console was identified.
I am adapting this and simply filtering out StdOutBE
and StdErrBE
👍
@@ -274,6 +275,25 @@ defaultInteractiveConfiguration minSeverity = | |||
in | |||
LoggerConfig{..} | |||
|
|||
-- | Handler to override another console 'LogHandler' and disable logging | |||
-- to console altogether. | |||
disabledConsoleConfiguration :: LoggerConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will write a test to demonstrate this..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
0ace1a1
to
b6fc657
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
lib/src/Pos/Launcher/Resource.hs
Outdated
-- add output to the console with severity filter >= Info | ||
Just False -> identity | ||
Just False -> lcLoggerTree . ltHandlers %~ filter (not . isWritingToConsole) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pedantic, there is a superfluous space.
LGTM! I like your solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ho right :o ... I'll remove 👍
|
For good reasons 😅 |
Also, interesting failure in Hydra:
@CodiePP Does that ring a bell? |
b6fc657
to
db94614
Compare
This was done in 7c59b1a but then overriden by a wrong merge-conflict resolution in f337564bf2743258dca7074867253d8f. This commits re-applies the patch on top of the new changes. Note that it turns out the 'Semigroup' instance for 'LoggerTree' was broken :/ (being left-associative instead of right-associative).
db94614
to
daf029e
Compare
Description
This was done in 7c59b1a but
then overriden by a wrong merge-conflict resolution in https://github.com/input-output-hk/cardano-sl/pull/3533/files#diff-f337564bf2743258dca7074867253d8fL241.
This commits re-applies the patch on top of the new changes.
Note that it turns out the 'Semigroup' instance for 'LoggerTree'
was broken :/ (being left-associative instead of right-associative).
Linked issue
Type of change
Developer checklist
[ ] CHANGELOG entry has been added and is linked to the correct PR on GitHub.Testing checklist
[ ] I have added tests to cover my changes.QA Steps
Screenshots (if available)