Hi Geoff
Geoff Air schrieb:
> I really WISH there was a way to re-direct this output
> to a disk FILE, so the whole output could be reviewed,
> but I have tried, and tried, with simgear logging, but
> have never quite succeeded ... I know, it should be
> 'simple' ;=))
> ...
> logbuf::overflow( int c )
> {
> #ifdef _MSC_VER
> static bool has_console = false;
> if ( logging_enabled ) {
> if ( !has_console ) {
> AllocConsole();
> freopen("conin$", "r", stdin);
> freopen("conout$", "w", stdout);
> freopen("conout$", "w", stderr);
> has_console = true;
> }
> return sbuf->sputc(c);
> }
> else
> return EOF == 0 ? 1: 0;
> #else
> return logging_enabled ? sbuf->sputc(c) : (EOF == 0 ? 1: 0);
> #endif
> }
>
>
If you change this to
> ...
> freopen("conin$", "r", stdin);
> freopen("stdout.txt", "w", stdout);
> freopen("stderr.txt", "w", stderr);
> ...
>
the the logging should be redirected to this files. But I didn't test
it. This change is in a header file which forces most of simgear and
flightgear to be recompiled, and on my old notebook this would need a
long time.
If we would use variables instead of the fixed filenames, this variables
can be set as a function of the arguments.
> In fact I am pretty sure the 'AllocConsole()' call is the
> 'newish' things that 'breaks' the old re-direction, but have
> not had the time to try different things ... or research
> back into history ...
>
>
Yes, this opens the new console. But without this, there is no console
attached and the output is lost :-(
I don't know how to attach an existing console.
> This 'problem' needs a pure windows solution ;=)) Where
> are the MSVC WIN32 developers when you really need them?
>
>
Sorry, my windows experience is very limited.
Maik
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel