On 7/31/07, Scott Morgan <[EMAIL PROTECTED]> wrote:
> I've got wxLua embedded in a standard wx app and it seems to be working
> well enough but I find myself lost if hit by an error in any script file
> as there is no console output. With normal lua I can just use the
> following to open up and attach a console in Windows code:
> ::AllocConsole();
> freopen( "CONOUT$", "a", stdout );    // Attach the stdout to the console
> freopen( "CONOUT$", "a", stderr );    // Attach the stderr too
> Which makes debugging scripts easy, but this doesn't work with wxLua. Is
> there an easy method for seeing the console output, doesn't have to be
> via a console window, could be piped to a file or some other method.

The print statements are trapped and wxLuaEvents are sent. Please see
apps/wxlua or apps/wxluaedit for how they're handled. Also
modules/wxlua/include/wxlstate.h and wxEVT_LUA_PRINT.

You could even push your own "print" statement into lua, replacing the
one wxLua pushes into it. See modules.wxlua/src/wxlstate.cpp and

    John Labenski

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
wxlua-users mailing list

Reply via email to