Enable log colors for most of tools in /usr/bin
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 Apr 2019 10:28:25 +0000 (12:28 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 8 May 2019 07:50:21 +0000 (09:50 +0200)
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.

26 files changed:
src/activate/activate.c
src/analyze/analyze.c
src/ask-password/ask-password.c
src/busctl/busctl.c
src/cgls/cgls.c
src/cgtop/cgtop.c
src/coredump/coredumpctl.c
src/delta/delta.c
src/detect-virt/detect-virt.c
src/escape/escape.c
src/hostname/hostnamectl.c
src/id128/id128.c
src/journal/cat.c
src/journal/journalctl.c
src/locale/localectl.c
src/login/inhibit.c
src/login/loginctl.c
src/machine/machinectl.c
src/mount/mount-tool.c
src/network/networkctl.c
src/notify/notify.c
src/path/path.c
src/portable/portablectl.c
src/resolve/resolvectl.c
src/run/run.c
src/timedate/timedatectl.c

index 48aa617..8bdf2e5 100644 (file)
@@ -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();
 
index 97d9451..09d26da 100644 (file)
@@ -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();
 
index 4637c32..ca6da40 100644 (file)
@@ -158,6 +158,7 @@ static int run(int argc, char *argv[]) {
         char **p;
         int r;
 
+        log_show_color(true);
         log_parse_environment();
         log_open();
 
index 86efc02..e702f93 100644 (file)
@@ -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();
 
index 09ee0e8..adc028b 100644 (file)
@@ -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();
 
index f27c801..de958b5 100644 (file)
@@ -909,6 +909,7 @@ static int run(int argc, char *argv[]) {
         CGroupMask mask;
         int r;
 
+        log_show_color(true);
         log_parse_environment();
         log_open();
 
index b239d81..e8aaa50 100644 (file)
@@ -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();
 
index c28a816..63baa74 100644 (file)
@@ -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();
 
index f05f227..7fb80ca 100644 (file)
@@ -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();
 
index 8b38d9f..9066c30 100644 (file)
@@ -159,6 +159,7 @@ static int run(int argc, char *argv[]) {
         char **i;
         int r;
 
+        log_show_color(true);
         log_parse_environment();
         log_open();
 
index 7f9bb49..22de735 100644 (file)
@@ -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();
 
index 60551ec..4b370d7 100644 (file)
@@ -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();
 
index 9900bd2..c28f3b6 100644 (file)
@@ -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();
 
index 0048909..3479535 100644 (file)
@@ -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();
 
index c8b195d..9fb5152 100644 (file)
@@ -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();
 
index 47fd9e8..d96c819 100644 (file)
@@ -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();
 
index 342ac56..fcd5e16 100644 (file)
@@ -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();
 
index d98027a..51bad26 100644 (file)
@@ -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();
 
index b290095..fcc4d4d 100644 (file)
@@ -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();
 
index 3881aaa..4c51ad6 100644 (file)
@@ -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();
 
index fff5233..0b518e1 100644 (file)
@@ -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();
 
index 7b630a5..568b5fb 100644 (file)
@@ -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();
 
index 2c59f04..5041745 100644 (file)
@@ -956,6 +956,7 @@ static int run(int argc, char *argv[]) {
 
         int r;
 
+        log_show_color(true);
         log_parse_environment();
         log_open();
 
index 1d2fc71..9637e00 100644 (file)
@@ -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();
 
index f200b28..05c1552 100644 (file)
@@ -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();
 
index 406ca1d..e03f179 100644 (file)
@@ -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();