Skip to content

Make glib log override as start option #1887

Description

@gaobo-kylinsec

Problem Statement

I have discovered that Caja overrides GLib's log output and persists it in memory. As a result, under certain extreme circumstances, the logs output by GLib remain in memory, causing Caja's memory usage to grow continuously. Moreover, this part of GLib logs is not very important.

Proposed Solution

Therefore, should we disable this override by default and add a startup parameter to support overriding GLib's logs if needed?
I make some change in my own repository, gaobo-kylinsec@526064c

or just like gnome nautilus, it just remove this function that override glib log

Alternatives Considered

No response

Use Case

How would you use this feature?

Launch caja with the --enable-glib-log-override flag when you need to capture GLib log messages (warnings, criticals,
debug output) into caja's own debug log system:

caja --enable-glib-log-override

For normal usage, simply run caja as before — GLib logs flow directly through the default handler without being
intercepted.

What workflow would it improve?

Previously, caja always intercepted all GLib log messages and routed them through its internal debug log system
(caja_debug_log). This default-on behavior has drawbacks:

  1. Unnecessary overhead for most users — The vast majority of users never inspect caja's debug log. Intercepting and
    re-logging every GLib message adds processing cost for no benefit.

By making this opt-in, developers who specifically need caja's debug log capture can enable it explicitly, while
everyone else gets clean, standard GLib logging behavior out of the box.

Additional Context

No response

Checklist

  • I have searched existing issues to avoid duplicates
  • I have considered if this feature fits the project scope

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions