From 782db5ac5c06dcaeb14b3ce67a55c49888450a7a Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 20 Jun 2012 11:38:27 +0200 Subject: [PATCH] cec-client: don't display debug output by default in 'cec-client -l' --- src/testclient/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 94bfd28..143cfdb 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -51,7 +51,8 @@ using namespace PLATFORM; ICECCallbacks g_callbacks; libcec_configuration g_config; -int g_cecLogLevel(CEC_LOG_ALL); +int g_cecLogLevel(-1); +int g_cecDefaultLogLevel(CEC_LOG_ALL); ofstream g_logOutput; bool g_bShortLog(false); CStdString g_strPort; @@ -1009,6 +1010,8 @@ bool ProcessCommandLineArguments(int argc, char *argv[]) else if (!strcmp(argv[iArgPtr], "--list-devices") || !strcmp(argv[iArgPtr], "-l")) { + if (g_cecLogLevel == -1) + g_cecLogLevel = CEC_LOG_WARNING + CEC_LOG_ERROR; ICECAdapter *parser = LibCecInitialise(&g_config); if (parser) { @@ -1032,6 +1035,9 @@ bool ProcessCommandLineArguments(int argc, char *argv[]) else if (!strcmp(argv[iArgPtr], "--help") || !strcmp(argv[iArgPtr], "-h")) { + if (g_cecLogLevel == -1) + g_cecLogLevel = CEC_LOG_WARNING + CEC_LOG_ERROR; + ShowHelpCommandLine(argv[0]); return 0; } @@ -1112,6 +1118,9 @@ int main (int argc, char *argv[]) if (!ProcessCommandLineArguments(argc, argv)) return 0; + if (g_cecLogLevel == -1) + g_cecLogLevel = g_cecDefaultLogLevel; + if (g_config.deviceTypes.IsEmpty()) { if (!g_bSingleCommand) -- 2.34.1