Separate user facing errors from system errors
The error shown in !5 (comment 1962) is nothing a user can deal with so we should make
- errors understandable for users
- write diagnostics messages to stderr / stdout only (using glibs logging and set G_LOG_DOMAIN)
You might want to resort to structured logging: https://blog.gtk.org/2017/05/04/logging-and-more/ by using G_LOG_USE_STRUCTURED.