From a05810f8e06d2ada661d431e978835dd667b878e Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 2 Apr 2014 04:47:32 -0700 Subject: [PATCH] dbgAt --- hledger-lib/Hledger/Utils.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index 40f3a95b6..9808abaa1 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -425,6 +425,11 @@ debugLevel = case snd $ break (=="--debug") args of dbg :: Show a => String -> a -> a dbg = dbgppshow 1 +-- | Print a message and a showable value to the console if the global +-- debug level is at or above the specified level. Uses unsafePerformIO. +dbgAt :: Show a => Int -> String -> a -> a +dbgAt lvl = dbgppshow lvl + -- | Print a showable value to the console, with a message, if the -- debug level is at or above the specified level (uses -- unsafePerformIO).