From c93b19cb108b86dec4304863e598486bfacf6c4a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 13 Apr 2014 11:05:20 -0700 Subject: [PATCH] more debug utils, dbg0/dbg1/dbg2 --- hledger-lib/Hledger/Utils.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index 55d7adf0d..f9ce36112 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -423,7 +423,16 @@ debugLevel = case snd $ break (=="--debug") args of -- | Print a message and a showable value to the console if the global -- debug level is non-zero. Uses unsafePerformIO. dbg :: Show a => String -> a -> a -dbg = dbgppshow 1 +dbg = dbg1 + +dbg0 :: Show a => String -> a -> a +dbg0 = dbgAt 0 + +dbg1 :: Show a => String -> a -> a +dbg1 = dbgAt 1 + +dbg2 :: Show a => String -> a -> a +dbg2 = dbgAt 2 -- | Print a message and a showable value to the console if the global -- debug level is at or above the specified level. Uses unsafePerformIO.