diff --git a/hledger-lib/Hledger/Data/Valuation.hs b/hledger-lib/Hledger/Data/Valuation.hs index b52502498..6016add54 100644 --- a/hledger-lib/Hledger/Data/Valuation.hs +++ b/hledger-lib/Hledger/Data/Valuation.hs @@ -364,6 +364,12 @@ pricesShortestPath start end edges = case concatMap extend paths of [] -> Nothing _ | pathlength > maxpathlength -> + -- XXX This is unusual: + -- 1. A warning, not an error, which we usually avoid + -- 2. Not a debug message (when triggered, we always print it) + -- 3. Printed either to stdout or (eg in hledger-ui) to the debug log file. + -- This is the only place we use traceOrLog like this. + -- Also before 1.32.2, traceOrLog was doing the opposite of what it should [#2134]. traceOrLog ("gave up searching for a price chain at length "++show maxpathlength++", please report a bug") Nothing where diff --git a/hledger-lib/Hledger/Utils/Debug.hs b/hledger-lib/Hledger/Utils/Debug.hs index ad5b1f524..44fe545a3 100644 --- a/hledger-lib/Hledger/Utils/Debug.hs +++ b/hledger-lib/Hledger/Utils/Debug.hs @@ -332,7 +332,7 @@ ptraceLogAtIO level label a = -- | Trace or log a string depending on shouldLog, -- before returning the second argument. traceOrLog :: String -> a -> a -traceOrLog = if shouldLog then trace else traceLog +traceOrLog = if shouldLog then traceLog else trace -- | Trace or log a string depending on shouldLog, -- when global debug level is at or above the specified level,