Skip to content

[Feature request]: Switch to g_info() for --verbose messages #5001

Closed

Description

@smcv

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Suggestion

At the moment, Flatpak has this output:

  • normally: GLib's implicit default, G_LOG_LEVEL_MESSAGE and up (from any domain)
  • with --verbose: G_LOG_LEVEL_DEBUG and up for the flatpak domain
  • with -v -v: G_LOG_LEVEL_DEBUG and up, both for the flatpak domain and a separate flatpak2 domain

This can result in reviewers not wanting some g_debug() messages to be emitted, because they are too verbose and would be confusing to users of flatpak -v. But having a separate flatpak2 domain for extra-verbose messages is also odd, and will cause those messages to be skipped if you run with G_MESSAGES_DEBUG=flatpak, which is unlikely to be what anyone expected.

In steam-runtime-tools, which recycles quite a lot of Flatpak code, I've had good results from this setup:

  • normally: GLib's implicit default, G_LOG_LEVEL_MESSAGE and up (from any domain)
  • with --verbose: G_LOG_LEVEL_INFO and up
  • with my project's equivalent of -v -v: G_LOG_LEVEL_DEBUG and up

G_MESSAGES_DEBUG also activates both G_LOG_LEVEL_INFO and G_LOG_LEVEL_DEBUG messages from the selected domains. I think that makes this a good pattern to encourage in any GLib-based software.

Does that sound like a reasonable model for Flatpak? If yes, the way to get there would be:

  • change all g_debug() to g_info()
  • change all flatpak_debug2() to g_debug(), and remove flatpak_debug2()
  • optionally review the debug messages and check whether any are at the wrong level

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions