lib: add level argument to fix traceAtWith
This commit is contained in:
parent
62d9e46adc
commit
1ad919bc6d
@ -168,9 +168,11 @@ traceAt level
|
|||||||
| level > 0 && debugLevel < level = flip const
|
| level > 0 && debugLevel < level = flip const
|
||||||
| otherwise = trace
|
| otherwise = trace
|
||||||
|
|
||||||
-- | Trace (print to stderr) a showable value using a custom show function.
|
-- | Trace (print to stderr) a showable value using a custom show function,
|
||||||
traceAtWith :: (a -> String) -> a -> a
|
-- if the global debug level is at or above the specified level.
|
||||||
traceAtWith f a = trace (f a) a
|
-- At level 0, always prints. Otherwise, uses unsafePerformIO.
|
||||||
|
traceAtWith :: Int -> (a -> String) -> a -> a
|
||||||
|
traceAtWith level f a = traceAt level (f a) a
|
||||||
|
|
||||||
-- | Pretty-print a label and a showable value to the console
|
-- | Pretty-print a label and a showable value to the console
|
||||||
-- if the global debug level is at or above the specified level.
|
-- if the global debug level is at or above the specified level.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user