[gme-users] Using console from interpreters
kitty at dre.vanderbilt.edu
Sun Nov 20 21:27:13 CST 2005
On Sun, 20 Nov 2005 19:41:24 -0600, Zoltan Molnar wrote:
> In case of BON2 interpreters BON::Project class has a consoleMsg method
> for writing HTML output to the console window. In case of raw COM
> interpreters you can use the IGMEOleApp's ConsoleMessage method.
> The content of the console window can be get/set with ConsoleContent
> property (method).
I knew about these functions. But what I was looking for an easier way
that doesn't introduce a dependency on COM. We have structured our
libraries such that the essential interpreter logic is independent of GME
(and COM/ATL/MFC), and we would like to get debug outputs for these
libraries be routed depending upon whether GME is being used or not. For
example, if stderr was hooked onto to the console using the Windows
equivalent of dup2 (assuming the console is backed up by a file
descriptor), then I could send debug output to stderr (and hence to the
std::cerr << "Interesting output" << std::endl;
The advantage being that my code doesn't have to be #ifdefd and doesn't
need to link to ATL/MFC et al., and be usable when run as a console program
(for example when the interpreter is invoked without GME running as is the
case in nightly regression testing of interpreters).
BTW, it would be nice if GME could timestamp (preferably with a resolution
in the order of seconds) all the messages that are output to the console so
that it is easy to figure out if the messages are new or old.
Krishnakumar B <kitty at dre dot vanderbilt dot edu>
Institute for Software Integrated Systems, Dept. of EECS, Vanderbilt University
More information about the gme-users