From 41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 17 Jun 2020 12:17:54 -0700 Subject: log: introduce log_parse_environment_cli() and log_setup_cli() Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities. --- src/delta/delta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/delta') diff --git a/src/delta/delta.c b/src/delta/delta.c index 2d80d3a664..29e5120375 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -643,9 +643,7 @@ static int parse_argv(int argc, char *argv[]) { static int run(int argc, char *argv[]) { int r, k, n_found = 0; - log_show_color(true); - log_parse_environment(); - log_open(); + log_setup_cli(); r = parse_argv(argc, argv); if (r <= 0) -- cgit v1.2.1