After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782504 - retro-gtk: Improve Libretro core logging
retro-gtk: Improve Libretro core logging
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: retro-gtk
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-11 08:33 UTC by Adrien Plazas
Modified: 2017-05-16 09:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log: Add retro_g_log() (1.88 KB, patch)
2017-05-16 08:57 UTC, Adrien Plazas
committed Details | Review
core: Add the 'log' signal (3.16 KB, patch)
2017-05-16 08:57 UTC, Adrien Plazas
committed Details | Review
log: Remove unused types (3.66 KB, patch)
2017-05-16 08:57 UTC, Adrien Plazas
committed Details | Review
retro: Log cores with Retro.g_log() (987 bytes, patch)
2017-05-16 09:00 UTC, Adrien Plazas
committed Details | Review

Description Adrien Plazas 2017-05-11 08:33:08 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.
Comment 1 Adrien Plazas 2017-05-16 08:57:32 UTC
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.
Comment 2 Adrien Plazas 2017-05-16 08:57:37 UTC
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.
Comment 3 Adrien Plazas 2017-05-16 08:57:42 UTC
Created attachment 351948 [details] [review]
log: Remove unused types

Remove LogLevel, Log and FileStreamLog.

This helps making the library simpler and cleaner.
Comment 4 Adrien Plazas 2017-05-16 09:00:28 UTC
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.
Comment 5 Adrien Plazas 2017-05-16 09:01:00 UTC
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
Comment 6 Adrien Plazas 2017-05-16 09:01:30 UTC
Attachment 351949 [details] pushed as e3b595a - retro: Log cores with Retro.g_log()