Closed brandonchinn178 closed 5 months ago
Could you add such a warning without introducing Ormolu.Logging
?
So without a logging framework, we would have to do the following:
This seemed rather annoying and not scalable, and I figured it'd be better to actually come up with a logging system that works in pure code.
I assume the biggest issue with this solution is the global ref? I think having a proper logging system would be better than the smattering of trace/putStrLn statements currently in the codebase. If the concern is with the global ref (which I agree is a bit code smelly), maybe I could store a LogContext in R and have the log functions take in the context?
Or maybe turn addFixityInfo into a StateT that outputs fixities different from base and print out the warnings when it gets back into the R monad?
On Thu, Oct 12, 2023, 10:32 AM Mark Karpov @.***> wrote:
Could you add such a warning without introducing Ormolu.Logging?
— Reply to this email directly, view it on GitHub https://github.com/tweag/ormolu/pull/1069#issuecomment-1760056345, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUC7EUUCIMA5PHDHLUKOH3X7ASTJANCNFSM6AAAAAA4SYFNS4 . You are receiving this because you authored the thread.Message ID: @.***>
@mrkkrp do you have any thoughts on the above approaches?
Resolves #1060
Tested with:
This shows the following with
--debug
: