Skip to content

Commit

Permalink
Set a log domain to allow restricting debug output to Nemo only.
Browse files Browse the repository at this point in the history
This eliminates having to enable all domains in order for Nemo's
debugging lines to print.
  • Loading branch information
mtwebster committed Apr 19, 2024
1 parent c626570 commit 0961f07
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libnemo-private/nemo-action.c
Original file line number Diff line number Diff line change
Expand Up @@ -2008,14 +2008,14 @@ nemo_action_update_display_state (NemoAction *action,
GtkWindow *window)
{
if (get_visibility (action, selection, parent, for_places, window)) {
DEBUG ("Action '%s' determined VISIBLE", gtk_action_get_name (GTK_ACTION (action)));
DEBUG ("Action '%s' determined VISIBLE", action->uuid);

finalize_strings (action, selection, parent, window);
gtk_action_set_visible (GTK_ACTION (action), TRUE);

return;
}

DEBUG ("Action '%s' determined HIDDEN", gtk_action_get_name (GTK_ACTION (action)));
DEBUG ("Action '%s' determined HIDDEN", action->uuid);
gtk_action_set_visible (GTK_ACTION (action), FALSE);
}
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ nemo_definitions = [
'-DNEMO_DATADIR="@0@"'.format(nemoDataPath),
'-DNEMO_EXTENSIONDIR="@0@"'.format(nemoExtensionPath),
'-DLIBEXECDIR="@0@"'.format(libExecPath),
'-DG_LOG_DOMAIN="Nemo"'
]

po_subdir = join_paths(meson.project_source_root(), 'po')
Expand Down
3 changes: 2 additions & 1 deletion src/nemo-desktop-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ nemo_desktop_application_local_command_line (GApplication *application,
}

if (debug) {
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
const gchar* const domains[] = { "Nemo", NULL };
g_log_writer_default_set_debug_domains (domains);
}

if (nemo_user_is_root () && !nemo_treating_root_as_normal ()) {
Expand Down
3 changes: 2 additions & 1 deletion src/nemo-main-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@ nemo_main_application_local_command_line (GApplication *application,
}

if (debug) {
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
const gchar* const domains[] = { "Nemo", NULL };
g_log_writer_default_set_debug_domains (domains);
}

if (!do_cmdline_sanity_checks (self, perform_self_check,
Expand Down

0 comments on commit 0961f07

Please sign in to comment.