Skip to content

Use g_info() for --verbose messages - #5219

Merged
smcv merged 5 commits into
flatpak:mainfrom
smcv:g-info-everywhere
Dec 15, 2022
Merged

smcv merged 5 commits into
flatpak:mainfrom
smcv:g-info-everywhere

Conversation

@smcv

@smcv smcv commented Dec 14, 2022 •

Copy link
Copy Markdown
Collaborator

Implements #5001.


  • common: Use g_info() for messages that will be shown by flatpak -v

    This brings us one step closer to being able to stop using the flatpak2
    log domain for messages that are exclusive to flatpak -v -v.

  • app: Use g_info() for messages that will be shown by flatpak -v

    This brings us one step closer to being able to stop using the flatpak2
    log domain for messages that are exclusive to flatpak -v -v.

  • daemons, etc.: Use g_info() for messages that are enabled by -v

  • common: Make flatpak_debug2() use the same domain as g_debug()

    Now that we are logging flatpak -v messages with log level INFO,
    and printing INFO messages in the same way as DEBUG, we can reserve
    log level DEBUG for flatpak -v -v messages. This means we no longer
    need a weird secondary debug domain.

    There is a very small behaviour change here: G_MESSAGES_DEBUG=flatpak
    is now similar to flatpak -v -v (previously flatpak -v), and
    G_MESSAGES_DEBUG=flatpak2 no longer has any effect. This seems more in
    line with what would be expected from a GLib-based application.

    In flatpak(1) and the system helper, this does not change behaviour
    other than that: the same messages are logged by -v and by -v -v
    as before.

    In daemons that do not implement -v -v (the OCI authenticator, portal
    and session helper), it continues to be necessary to use
    G_MESSAGES_DEBUG to see flatpak_debug2() messages.

  • common: Replace all flatpak_debug2() with g_debug()

    They are now equivalent.

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

smcv added 5 commits December 14, 2022 20:03
This brings us one step closer to being able to stop using the flatpak2
log domain for messages that are exclusive to `flatpak -v -v`.

Signed-off-by: Simon McVittie <[email protected]>
This brings us one step closer to being able to stop using the flatpak2
log domain for messages that are exclusive to `flatpak -v -v`.

Signed-off-by: Simon McVittie <[email protected]>
Now that we are logging `flatpak -v` messages with log level INFO,
and printing INFO messages in the same way as DEBUG, we can reserve
log level DEBUG for `flatpak -v -v` messages. This means we no longer
need a weird secondary debug domain.

There is a very small behaviour change here: G_MESSAGES_DEBUG=flatpak
is now similar to `flatpak -v -v` (previously `flatpak -v`), and
G_MESSAGES_DEBUG=flatpak2 no longer has any effect. This seems more in
line with what would be expected from a GLib-based application.

In flatpak(1) and the system helper, this does not change behaviour
other than that: the same messages are logged by `-v` and by `-v -v`
as before.

In daemons that do not implement `-v -v` (the OCI authenticator, portal
and session helper), it continues to be necessary to use
G_MESSAGES_DEBUG to see flatpak_debug2() messages.

Signed-off-by: Simon McVittie <[email protected]>
They are now equivalent.

Resolves: flatpak#5001
Signed-off-by: Simon McVittie <[email protected]>
@smcv

smcv commented Dec 14, 2022

Copy link
Copy Markdown
Collaborator Author

Rebased after #5218 was merged, no further changes. I'll land this when CI has passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants