mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 02:54:26 +00:00
Allow turning off the timestamp prefix for debugging
This makes it easier to 'diff' the fwupd and fwupdtool output between runs.
This commit is contained in:
parent
5e952ce35f
commit
d8aaa21cde
@ -17,6 +17,7 @@ typedef struct {
|
|||||||
GOptionGroup *group;
|
GOptionGroup *group;
|
||||||
gboolean verbose;
|
gboolean verbose;
|
||||||
gboolean console;
|
gboolean console;
|
||||||
|
gboolean no_timestamp;
|
||||||
gchar **plugin_verbose;
|
gchar **plugin_verbose;
|
||||||
gchar **daemon_verbose;
|
gchar **daemon_verbose;
|
||||||
} FuDebug;
|
} FuDebug;
|
||||||
@ -73,11 +74,13 @@ fu_debug_handler_cb (const gchar *log_domain,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* time header */
|
/* time header */
|
||||||
tmp = g_strdup_printf ("%02i:%02i:%02i:%04i",
|
if (!self->no_timestamp) {
|
||||||
g_date_time_get_hour (dt),
|
tmp = g_strdup_printf ("%02i:%02i:%02i:%04i",
|
||||||
g_date_time_get_minute (dt),
|
g_date_time_get_hour (dt),
|
||||||
g_date_time_get_second (dt),
|
g_date_time_get_minute (dt),
|
||||||
g_date_time_get_microsecond (dt) / 1000);
|
g_date_time_get_second (dt),
|
||||||
|
g_date_time_get_microsecond (dt) / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
/* each file should have set this */
|
/* each file should have set this */
|
||||||
if (log_domain == NULL)
|
if (log_domain == NULL)
|
||||||
@ -129,6 +132,9 @@ fu_debug_pre_parse_hook (GOptionContext *context,
|
|||||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &self->verbose,
|
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &self->verbose,
|
||||||
/* TRANSLATORS: turn on all debugging */
|
/* TRANSLATORS: turn on all debugging */
|
||||||
N_("Show debugging information for all domains"), NULL },
|
N_("Show debugging information for all domains"), NULL },
|
||||||
|
{ "no-timestamp", '\0', 0, G_OPTION_ARG_NONE, &self->no_timestamp,
|
||||||
|
/* TRANSLATORS: turn on all debugging */
|
||||||
|
N_("Do not include timestamp prefix"), NULL },
|
||||||
{ "plugin-verbose", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &self->plugin_verbose,
|
{ "plugin-verbose", '\0', 0, G_OPTION_ARG_STRING_ARRAY, &self->plugin_verbose,
|
||||||
/* TRANSLATORS: this is for plugin development */
|
/* TRANSLATORS: this is for plugin development */
|
||||||
N_("Show plugin verbose information"), "PLUGIN-NAME" },
|
N_("Show plugin verbose information"), "PLUGIN-NAME" },
|
||||||
|
Loading…
Reference in New Issue
Block a user