Disable messages with GHC API

Daniel Gröber dxld at darkboxed.org
Fri Feb 3 15:57:07 UTC 2017


On Fri, Feb 03, 2017 at 12:21:38PM +0000, Christopher Done wrote:
> I tried the following before calling getModInfo, expecting there to be
> no output anymore:
> 
> +      GHC.setSessionDynFlags
> +        df {log_action = \ref dflags severity srcSpan style msg -> return ()}

That is pretty much exactly what I do in ghc-mod to suppress all
output (other than the SourceError exceptions) so it's strange that
wouldn't work.

Have you tried making a small self contained test case for your
problem, maybe it's something intero specific? How far has it diverged
from it's GHCi roots these days anyways?

Here's[1] a small testcase I usually modify to test various GHC oddities
when I'm not sure if my ghc-mod monad magic is doing something werid
or not, might be helpful:

[1]: https://github.com/DanielG/ghc-mod/blob/master/test/manual/not-interpreted-error/GhcTestcase.hs

--Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170203/a1d4ea19/attachment.sig>


More information about the ghc-devs mailing list