Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to disable (and/or disable by default) Allegro logging to stdout under debugging on Windows. #1548

Open
SiegeLord opened this issue Mar 24, 2024 · 5 comments

Comments

@SiegeLord
Copy link
Member

No description provided.

@pedro-w
Copy link
Contributor

pedro-w commented Mar 25, 2024

(from discord...)
https://github.com/liballeg/allegro5/blob/master/src/debug.c#L324
So we always OutputDebugString on windows, write to stderr on iOS, __android_log_print on android, and write to trace_info.trace_file if that is specified?

@SiegeLord
Copy link
Member Author

The Windows is a standout, since the mobile platforms don't have a way to output a log file. Windows writes both to debug window and file by default. I kept thinking about this today, and I'm inclined to disable OutputDebugString by default.

@pedro-w
Copy link
Contributor

pedro-w commented Mar 25, 2024

One possibility is to add a nativelog=0 / nativelog=1 option to allegro5.cfg with the default being 1 for the mobile platforms and 0 for the desktop platforms?
Is part of the problem that the default logging spews out too much info - i.e should the default level be INFO and not DEBUG? (actually it's 999 in DEBUGMODE which is a bit like the Spinal Tap "turn up to 11"!)

@SiegeLord
Copy link
Member Author

One possibility is to add a nativelog=0 / nativelog=1 option to allegro5.cfg with the default being 1 for the mobile platforms and 0 for the desktop platforms?

Not a bad idea!

Is part of the problem that the default logging spews out too much info - i.e should the default level be INFO and not DEBUG? (actually it's 999 in DEBUGMODE which is a bit like the Spinal Tap "turn up to 11"!)

Yeah, we talked about this on discord. One suggestion I had was to add another level under debug (VERBOSE or something) and move the spammy logs to it instead.

@pedro-w
Copy link
Contributor

pedro-w commented Mar 26, 2024

actually it's 999 in DEBUGMODE

Whoops - wrong way round - the levels are DEBUG=0 up to ERROR=3 and 999 is set in release mode for "output nothing"

I can't see any consistent pattern in the Allegro source for what has been assigned to ALLEGRO_DEBUG vs ALLEGRO_INFO - as you say the best thing might be to add extra verbose level, leave most alone and just move the spammiest ones.
traceinfo.level is a signed int so the new level could be -1 I think, would need to check. Then the default level in DEBUGMODE being 0 would automatically omit those verbose logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants