1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
module Output where
import Unsafe (unsafePerformIO)
import CCTOptions (CCTOpts (..), Verbosity (..))
traceEval :: CCTOpts -> String -> a -> a
traceEval opts msg x = unsafePerformIO (debugEval opts msg >> return x)
traceInfo :: CCTOpts -> String -> a -> a
traceInfo opts msg x = unsafePerformIO (info opts msg >> return x)
traceStatus :: CCTOpts -> String -> a -> a
traceStatus opts msg x = unsafePerformIO (status opts msg >> return x)
status :: CCTOpts -> String -> IO ()
status opts msg = when (optVerbosity opts >= Status) (putMsg msg)
info :: CCTOpts -> String -> IO ()
info opts msg = when (optVerbosity opts >= Info) (putMsg msg)
debug :: CCTOpts -> String -> IO ()
debug opts msg = when (optVerbosity opts >= Debug) (putMsg msg)
debugEval :: CCTOpts -> String -> IO ()
debugEval opts msg
= when (optDebugEval opts || optVerbosity opts >= Debug) (putMsg msg)
debugSearch :: CCTOpts -> String -> IO ()
debugSearch opts msg
= when (optDebugSearch opts || optVerbosity opts >= Debug) (putMsg msg)
putMsg :: String -> IO ()
putMsg msg = putStrLn (replicate 120 '=') >> putStrLn msg
|