SDL - Spurious error messages

Sam Lantinga wrote:

Is there any way to prevent SDL from printing spurious messages ?

I get the following messages:

video memory unprotecting
video memory protecting

These come from the X libraries, and can’t be avoided.

You must be root to set a fullscreen mode

This is just an informational note, and can be removed from the library
source if you want.

I think it’s not the job of any library to print messages.
Plus, this goes against internationalization (most
chineese people do not read english!).

A library should return error codes etc and the application
should display a message or take any appropriate action when
the error occurs (maybe put the message in a window ?).

For example, if SDL_SetVideoMode() cannot set SDL_FULLSCREEN,
it should probably return an error status (e.g. errno
or returned value) that can be tested by the application to find the
reason why SDL_SetVideoMode() could not set SDL_FULLSCREEN,
and take the appropriate action (e.g. print a message in chineese ?).

This remark is general to all libraries, not just SDL.

I suggest that it would be a good idea for futur versions
of SDL (a very useful library, by the way!) to follow that rule.
Also, the X libraries should not print spurious messages, IMHO.

Alternatively, you can redirect stderr to /dev/null, but that might be
overkill.

I certainely do not want to do that, and there may be messages
that my application prints on STDOUT that I want to see. But
IMHO libraries should not interfer with my stdout and stderr
(except in debug mode or when library routines are supposed
to write on sdtout or stderr, of course).

-t

Sam Lantinga wrote:

Is there any way to prevent SDL from printing spurious messages ?

I get the following messages:

video memory unprotecting
video memory protecting

These come from the X libraries, and can’t be avoided.

You must be root to set a fullscreen mode

This is just an informational note, and can be removed from the library
source if you want.

I think it’s not the job of any library to print messages.
Plus, this goes against internationalization (most
chineese people do not read english!).

Note that this is an issue with the XFree86 libraries, not SDL. Other
libraries do this too, like GTK+.

Usually, error messages are not i18n’ed, only the stuff that’s sent as
output to the user’s display. When I write config tools for TurboLinux, I
keep the debugging logs in English so that I can do tech support, for
example, but the main interface uses gettext calls so that we can support
Japanese and Chinese (and others).

And, from my experience, most Chinese people that are computer users DO
read English. Same with Japanese and Europeans (esp. Germans - in
Germany, computer professionals are pretty much required to be fluent in
English, or so I hear from my colleagues in Germany).On Mon, 14 Dec 1998, Tristan Savatier wrote:


Scott M. Stone <sstone at pht.com, sstone at pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)

A library should return error codes etc and the application
should display a message or take any appropriate action when
the error occurs (maybe put the message in a window ?).

I will probably ifdef the warning messages out of the latest versions
of SDL.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/