-
-{-# NOINLINE tracers #-}
-tracers :: IORef [(String, String -> IO ())]
-tracers = unsafePerformIO (newIORef [("defaultTracer", fileTracer stderr)])
-
--- | A tracer function that outputs the message to a file
-fileTracer :: Handle -- ^ file handle
- -> String -- ^ trace message
- -> IO ()
-fileTracer handle msg = do
- hPutStr handle msg
- hPutChar handle '\n'
-
-#ifdef mingw32_TARGET_OS
--- | A tracer function that outputs the message to the debuger (Windows only)
-winDebugTracer :: String -- ^ trace message
- -> IO ()
-winDebugTracer msg = do
- withCString (msg++"\n") outputDebugString
-
-foreign import ccall unsafe "OutputDebugStringA"
- outputDebugString :: CString -> IO ()