GNOME Bugzilla – Bug 782504
retro-gtk: Improve Libretro core logging
Last modified: 2017-05-16 09:01:35 UTC
Currently log messages from the Libretro core are redirected to their corresponding g_* logging function (debug messages to g_debug…). This causes two problems: - the log domain will be retro-gtk instead of the core's name - if structured logging is enabled a function name and a code line from retro-gtk will be added, which would be wrong as the messages come from the Libretro cores To work around this I suggest to use g_log directly, using the Libretro core's name as the log domain and to ensure we never write a structured logs containing non pertinent information. If we expose the log level to the outside world I also suggest to use GLib log levels instead of the Libretro ones, as they match one to one: that would avoid exposing more symbols and tighten integration with the G* world.
Created attachment 351946 [details] [review] log: Add retro_g_log() This will be used to easily let clients log messages from the core in an easy way while keeping control over how the logging is done.
Created attachment 351947 [details] [review] core: Add the 'log' signal Allow to log messages from the Libretro cores in a similar fashion to g_log(). This will be used to easily let clients log messages from the core in an easy way while keeping control over how the logging is done.
Created attachment 351948 [details] [review] log: Remove unused types Remove LogLevel, Log and FileStreamLog. This helps making the library simpler and cleaner.
Created attachment 351949 [details] [review] retro: Log cores with Retro.g_log() This allows to keep printing logs for the Libretro cores and it avoids adding useless information like the line emitting the error from retro-gtk and add useful ones like the core's name as the log domain.
Attachment 351946 [details] pushed as f881eb1 - log: Add retro_g_log() Attachment 351947 [details] pushed as a8f7c8f - core: Add the 'log' signal Attachment 351948 [details] pushed as 6894f02 - log: Remove unused types
Attachment 351949 [details] pushed as e3b595a - retro: Log cores with Retro.g_log()