dbgtrace takes a level parameter

This commit is contained in:
Simon Michael 2016-07-05 14:09:21 -07:00
parent 427953728e
commit 2d7a1904b4

View File

@ -181,10 +181,10 @@ tracePrettyAtIO lvl lbl x = liftIO $ tracePrettyAt lvl lbl x `seq` return ()
-- tracePrettyAtM lvl lbl x = tracePrettyAt lvl lbl x `seq` return x
-- | print this string to the console before evaluating the expression,
-- if the global debug level is non-zero. Uses unsafePerformIO.
dbgtrace :: String -> a -> a
dbgtrace
| debugLevel > 0 = trace
-- if the global debug level is at or above the specified level. Uses unsafePerformIO.
dbgtrace :: Int -> String -> a -> a
dbgtrace level
| debugLevel >= level = trace
| otherwise = flip const
-- | Print a showable value to the console, with a message, if the