bankd, client, server: add -L option to disable log coloring

When the stderr of these services is sent to syslog, for example by
using systemd's StandardError=syslog, syslog's escaping of ANSI color
ESC sequences in log messages really clutter the log files. This
option allows log coloring to be disabled on the command line.

Change-Id: I6955b0af1ceb11a4029383e32bb298ee8da7503f
diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index 3fd4d6b..90b05d8 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -301,6 +301,7 @@
 "  -s --permit-shared-pcsc      Permit SHARED access to PC/SC readers (default: exclusive)\n"
 "  -g --gsmtap-ip A.B.C.D       Enable GSMTAP and send APDU traces to given IP\n"
 "  -G --gsmtap-slot <0-1023>    Limit tracing to given bank slot, only (default: all slots)\n"
+"  -L --disable-color           Disable colors for logging to stderr\n"
 	      );
 }
 
@@ -325,10 +326,11 @@
 			{ "permit-shared-pcsc", 0, 0, 's' },
 			{ "gsmtap-ip", 1, 0, 'g' },
 			{ "gsmtap-slot", 1, 0, 'G' },
+			{ "disable-color", 0, 0, 'L' },
 			{ 0, 0, 0, 0 }
 		};
 
-		c = getopt_long(argc, argv, "hVd:i:p:b:n:N:I:P:sg:G:", long_options, &option_index);
+		c = getopt_long(argc, argv, "hVd:i:p:b:n:N:I:P:sg:G:L", long_options, &option_index);
 		if (c == -1)
 			break;
 
@@ -374,6 +376,9 @@
 		case 'G':
 			g_bankd->cfg.gsmtap_slot = atoi(optarg);
 			break;
+		case 'L':
+			log_set_use_color(osmo_stderr_target, 0);
+			break;
 		}
 	}
 }