dbgtrace, does a trace if --debug was used
This commit is contained in:
		
							parent
							
								
									18716f2908
								
							
						
					
					
						commit
						6871c4cce5
					
				@ -453,6 +453,13 @@ dbgAt lvl = dbgppshow lvl
 | 
				
			|||||||
dbgAtM :: Show a => Int -> String -> a -> IO ()
 | 
					dbgAtM :: Show a => Int -> String -> a -> IO ()
 | 
				
			||||||
dbgAtM lvl lbl x = dbgAt lvl lbl x `seq` return ()
 | 
					dbgAtM lvl lbl x = dbgAt lvl lbl x `seq` return ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- | 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
 | 
				
			||||||
 | 
					    | otherwise      = flip const
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- | Print a showable value to the console, with a message, if the
 | 
					-- | Print a showable value to the console, with a message, if the
 | 
				
			||||||
-- debug level is at or above the specified level (uses
 | 
					-- debug level is at or above the specified level (uses
 | 
				
			||||||
-- unsafePerformIO).
 | 
					-- unsafePerformIO).
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user