On 1 September 2011 21:18, Dave Tapley <duked...@gmail.com> wrote:

> 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"))
>
>
Further to this I can reveal that it only occurs when wxWidgets is built
with --enable-debug, ironically.
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel

Reply via email to