[SDL] I/O problem (stdio and stderr redirection to txt files)
david at olofson.net
Thu Mar 17 07:14:39 PST 2005
On Thursday 17 March 2005 15.33, Tom Wilson wrote:
> > How about because they do different things?
> No, I this is the same issue.
No, but they're closely related. :-)
> Your proposal deals with letting the _developer_ query for
> > error information.
> Yes, it does exactly that. I think it would be a waste of effort to
> make a library that gathers the stderr info and displays it.
That's an implementation detail, but yes; there are better ways, at
least in theory.
> be better to reform/patch the current way that error information is
> obtained in SDL, and then create a library that displays the
Yes, but SDL is probably the *least* frequent user of stderr/stdout in
your average SDL application. Having SDL put error messages in some
place where an application or add-on library could easilly get at it
would be great, but what about libs and applications that already
does lots of printing to stdout/stderr?
If we can't redirect stderr and stdout, we should at least provide a
"lagacy" interface that's compatible enough that one could just
Not saying we should have *only* an stdio style interface. Might as
well provide some conrol codes for timestamps and such while we're at
it, but I have a feeling that complicating it too much will just
result in everyone continuing to (ab)use printf(), for eternal end
user headscratching. (Frankly, I have a feeling they will anyway, but
we'll never find out unless we hack this thing. :-)
BTW, I'm thinking that this thing might actually be better off as a
"throw into project" C file, or static-only lib or something, and
entirely self-contained... Kinda' silly to have it fail to say
"Cannot find data files!" just because it can't find it's *own*
BTW(2), I have a simple printf() style logger lying around, that can
send plain text, ANSI colored text and HTML to stdout/stderr or to a
file. Might fit in somewhere, I dunno...
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
More information about the SDL