pcscd can not be startet with log level "info"

Maximilian Stein <[email protected]> Tue, 6 Jun 2017 17:09:37 +0200
Newsgroups gmane.comp.lib.muscle
Message-ID <[email protected]>
--------------A342E5F71DA9125D5639E04B
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Hello,

since Version 1.5.5 (2009) the pcscd can not be started with log level
"info" any more. This is because the default debug level was changed
from "info" to "error" in commit [1] and "info" could never be set
explicitly (see [2] and [3]). I agree to the default log level "error",
but sometimes I would like to have the "info" log without the "debug" noise.

The attached patch adds the short command line option '-i' and the
according case in the getopt evaluation loop. '-i' was currently unused,
but I haven't checked if it had a different meaning in earlier Versions.

Best regards
Maximilian

[1] 065ca3de137866e380cbde046b52adc14e012dad
[2] 5a8c65a9b37d7afc992e059ba6b056aae9a8a0c3
[3] b2894ab7874fbd907e62ce526659fdae21818384

--------------A342E5F71DA9125D5639E04B
Content-Type: text/x-patch; name="Enable-info-level-logging.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="Enable-info-level-logging.patch"

=46rom dc94272eec2463577f2b74a3c063e1be0a40dce6 Mon Sep 17 00:00:00 2001
From: Maximilian Stein <[email protected]>
Date: Wed, 3 May 2017 15:29:45 +0200
Subject: [PATCH] Enable info level logging

---
 src/pcscdaemon.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c
index 1e5df53..09abc7c 100644
--- a/src/pcscdaemon.c
+++ b/src/pcscdaemon.c
@@ -275,7 +275,7 @@ int main(int argc, char **argv)
 		{"version", 0, NULL, 'v'},
 		{"apdu", 0, NULL, 'a'},
 		{"debug", 0, NULL, 'd'},
-		{"info", 0, NULL, 0},
+		{"info", 0, NULL, 'i'},
 		{"error", 0, NULL, 'e'},
 		{"critical", 0, NULL, 'C'},
 		{"hotplug", 0, NULL, 'H'},
@@ -289,7 +289,7 @@ int main(int argc, char **argv)
 		{NULL, 0, NULL, 0}
 	};
 #endif
-#define OPT_STRING "c:fTdhvaeCHt:r:s:xSI"
+#define OPT_STRING "c:fTdhvaieCHt:r:s:xSI"
=20
 	newReaderConfig =3D NULL;
 	setToForeground =3D FALSE;
@@ -355,6 +355,10 @@ int main(int argc, char **argv)
 				DebugLogSetLevel(PCSC_LOG_DEBUG);
 				break;
=20
+			case 'i':
+				DebugLogSetLevel(PCSC_LOG_INFO);
+				break;
+
 			case 'e':
 				DebugLogSetLevel(PCSC_LOG_ERROR);
 				break;
@@ -852,7 +856,7 @@ static void print_usage (char const * const progname)=

 	printf("  -H, --hotplug		ask the daemon to rescan the available readers=
\n");
 	printf("  -v, --version		display the program version number\n");
 	printf("  -d, --debug		display lower level debug messages\n");
-	printf("      --info		display info level debug messages\n");
+	printf("  -i, --info		display info level debug messages\n");
 	printf("  -e  --error		display error level debug messages (default leve=
l)\n");
 	printf("  -C  --critical	display critical only level debug messages\n")=
;
 	printf("  --force-reader-polling ignore the IFD_GENERATE_HOTPLUG reader=
 capability\n");
@@ -868,6 +872,7 @@ static void print_usage (char const * const progname)=

 	printf("  -f	run in foreground (no daemon), send logs to stdout instead=
 of syslog\n");
 	printf("  -T    force use of colored logs\n");
 	printf("  -d	display debug messages.\n");
+	printf("  -i	display info messages.\n");
 	printf("  -e	display error messages (default level).\n");
 	printf("  -C	display critical messages.\n");
 	printf("  -h	display usage information\n");
--=20
2.7.4


--------------A342E5F71DA9125D5639E04B
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Pcsclite-muscle mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
--------------A342E5F71DA9125D5639E04B--