From: Zbigniew Jędrzejewski-Szmek Date: Fri, 26 Apr 2019 10:28:25 +0000 (+0200) Subject: Enable log colors for most of tools in /usr/bin X-Git-Tag: v243-rc1~467^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a04395959ca8cdca91f9da86b8580ef27025a5f;p=thirdparty%2Fsystemd.git Enable log colors for most of tools in /usr/bin When emitting the calendarspec warning we want to see some color. Follow-up for 04220fda5c. Exceptions: - systemctl, because it has a lot hand-crafted coloring - tmpfiles, sysusers, stdio-bridge, etc, because they are also used in services and I'm not sure if this wouldn't mess up something. --- diff --git a/src/activate/activate.c b/src/activate/activate.c index 48aa617e784..8bdf2e50aae 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -474,6 +474,7 @@ int main(int argc, char **argv, char **envp) { int r, n; int epoll_fd = -1; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index 97d94516c87..09d26da0db4 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -2104,6 +2104,7 @@ static int run(int argc, char *argv[]) { setlocale(LC_ALL, ""); setlocale(LC_NUMERIC, "C"); /* we want to format/parse floats in C style */ + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c index 4637c328193..ca6da40bbc9 100644 --- a/src/ask-password/ask-password.c +++ b/src/ask-password/ask-password.c @@ -158,6 +158,7 @@ static int run(int argc, char *argv[]) { char **p; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 86efc02bd8c..e702f9366a9 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -2508,6 +2508,7 @@ static int busctl_main(int argc, char *argv[]) { static int run(int argc, char *argv[]) { int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c index 09ee0e86a24..adc028bc8e6 100644 --- a/src/cgls/cgls.c +++ b/src/cgls/cgls.c @@ -165,6 +165,7 @@ static void show_cg_info(const char *controller, const char *path) { static int run(int argc, char *argv[]) { int r, output_flags; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index f27c80120d6..de958b57dd0 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -909,6 +909,7 @@ static int run(int argc, char *argv[]) { CGroupMask mask; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index b239d819451..e8aaa502352 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -1069,6 +1069,7 @@ static int run(int argc, char *argv[]) { int r, units_active; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/delta/delta.c b/src/delta/delta.c index c28a816d677..63baa747949 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -639,6 +639,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(); diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c index f05f2279b35..7fb80ca138a 100644 --- a/src/detect-virt/detect-virt.c +++ b/src/detect-virt/detect-virt.c @@ -128,6 +128,7 @@ static int run(int argc, char *argv[]) { * to detect whether we are being run in a virtualized * environment or not */ + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/escape/escape.c b/src/escape/escape.c index 8b38d9f6795..9066c30853b 100644 --- a/src/escape/escape.c +++ b/src/escape/escape.c @@ -159,6 +159,7 @@ static int run(int argc, char *argv[]) { char **i; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 7f9bb49e0c9..22de7350fe7 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -432,6 +432,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/id128/id128.c b/src/id128/id128.c index 60551ec2258..4b370d700d5 100644 --- a/src/id128/id128.c +++ b/src/id128/id128.c @@ -155,6 +155,7 @@ static int id128_main(int argc, char *argv[]) { static int run(int argc, char *argv[]) { int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/journal/cat.c b/src/journal/cat.c index 9900bd2e863..c28f3b6d801 100644 --- a/src/journal/cat.c +++ b/src/journal/cat.c @@ -127,6 +127,7 @@ static int run(int argc, char *argv[]) { _cleanup_close_ int outfd = -1, errfd = -1, saved_stderr = -1; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 00489098eee..3479535ba7f 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2100,6 +2100,7 @@ int main(int argc, char *argv[]) { int n_shown = 0, r, poll_fd = -1; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/locale/localectl.c b/src/locale/localectl.c index c8b195d9a6c..9fb51521109 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -510,6 +510,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/login/inhibit.c b/src/login/inhibit.c index 47fd9e874da..d96c8195a28 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -270,6 +270,7 @@ static int run(int argc, char *argv[]) { _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 342ac56d904..fcd5e169a9e 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -1529,6 +1529,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index d98027a0ca5..51bad267d88 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -3100,6 +3100,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index b290095b0e9..fcc4d4da61a 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -1525,6 +1525,7 @@ static int run(int argc, char* argv[]) { _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 3881aaa42b5..4c51ad6a89c 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -1128,6 +1128,7 @@ static void warn_networkd_missing(void) { static int run(int argc, char* argv[]) { int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/notify/notify.c b/src/notify/notify.c index fff5233b0cb..0b518e16041 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -151,6 +151,7 @@ static int run(int argc, char* argv[]) { unsigned i = 0; int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/path/path.c b/src/path/path.c index 7b630a5714a..568b5fb04be 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -171,6 +171,7 @@ static int parse_argv(int argc, char *argv[]) { static int run(int argc, char* argv[]) { int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 2c59f04eb5e..5041745b3d0 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -956,6 +956,7 @@ static int run(int argc, char *argv[]) { int r; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 1d2fc713092..9637e00e607 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -3137,6 +3137,7 @@ static int run(int argc, char **argv) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/run/run.c b/src/run/run.c index f200b28dfe5..05c1552a8b7 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1652,6 +1652,7 @@ static int run(int argc, char* argv[]) { _cleanup_free_ char *description = NULL; int r, retval = EXIT_SUCCESS; + log_show_color(true); log_parse_environment(); log_open(); diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 406ca1df661..e03f1796e73 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -866,6 +866,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); + log_show_color(true); log_parse_environment(); log_open();