lib: debug output now respects --color/NO_COLOR/ANSI support

Debug output now selects color or monochrome in the same way as normal
output.
This commit is contained in:
Simon Michael 2021-04-13 14:06:02 -10:00
parent 5e57cfb43e
commit 2b04b76448

View File

@ -116,12 +116,14 @@ import System.Console.ANSI (hSupportsANSIColor)
import System.IO (stdout)
prettyopts =
defaultOutputOptionsDarkBg
-- defaultOutputOptionsLightBg
-- defaultOutputOptionsNoColor
baseopts
{ outputOptionsIndentAmount=2
, outputOptionsCompact=True
}
where
baseopts
| useColor = defaultOutputOptionsDarkBg -- defaultOutputOptionsLightBg
| otherwise = defaultOutputOptionsNoColor
-- | Pretty print. Generic alias for pretty-simple's pPrint.
pprint :: Show a => a -> IO ()