|
From: Dave T. <duk...@gm...> - 2011-09-01 20:18:45
|
I don't know if this is a known issue which I've stumbled across using the Debug.Trace library: If you run this sample code¹ you'll see that six lines of output are generated. Now uncomment the WX import and try again, you should see only four lines of output. It appears anything written to stderr is being eaten up in any module which imports WX, which is fairly inconvenient. Can anyone think why this could be? Notably the Debug.Trace module states: "Usually the output stream is System.IO.stderr but if the function is called from Windows GUI application then the output will be directed to the Windows debug console". So I'd be interested to have a Windows user try this out. ¹ wx_stderr_test.hs: module Main where -- import Graphics.UI.WX import Debug.Trace import System.IO.Unsafe main :: IO () main = do print (trace "DEBUG_TRACE" "APPLE") print (unsafePerformIO (putTraceMsg "UNSAFE_TRACE_MSG" >> return "BANANA")) print (unsafePerformIO (putStrLn "UNSAFE_PUT_STR" >> return "CUCUMBER")) |