1 {-# LANGUAGE OverloadedStrings #-}
11 , printf -- TODO: delete me
16 import System.IO.Unsafe
20 {-# NOINLINE logHandle #-}
21 -- TODO(bernhard): use MVar if threaded
23 logHandle = unsafePerformIO $ openFile "mate.log" WriteMode
25 {-# INLINE mateDEBUG #-}
29 {-# INLINE printString #-}
30 printString :: String -> String -> IO ()
31 printString prefix str = when mateDEBUG $ hPutStr logHandle . (++) prefix $ str
34 printfJit, printfBb, printfMp, printfCp, printfStr, printfInfo :: String -> IO ()
37 -- http://stackoverflow.com/questions/12123082/function-composition-with-text-printf-printf
39 printfJit = printString "Jit: "
40 printfBb = printString "Bb: "
41 printfMp = printString "Mp: "
42 printfCp = printString "Cp: "
43 printfStr = printString "Str: "
44 printfInfo = printString "Info: "