Clean up logging
Our logging is all over the place.
We have code using g_logv
(g_debug/g_info/g_warning/g_critical/g_error), code using g_printerr
, code using fprintf(stderr,...)
, etc.
None of these seems ideal, and mixing it all is just wrong.
Looking at the individual options:
g_logv:
Advantages:
- Can be redirected
- Has its own filtering mechanism
Disadvantages:
- Clunky prefixes with the default handlers, and overriding handlers is application territory
- Filtering is insufficient (can anybody remember how to get only OpenGL-related debug messages with just the g_logv env vars?)
- g_error dumps core, and is documented as 'for programmatic errors', nothing else
g_printerr:
Advantages:
- Can be redirected
Disadvantages:
- No filtering
- Documented as 'only for applications, not for libraries'
fprintf:
Advantages:
- Clean base to build our filtering on
Disadvantages:
- Can't be redirected
- Needs macro wrappers to add a newline
Edited by Matthias Clasen