From: Lars Op den Kamp Date: Wed, 20 Jun 2012 09:38:27 +0000 (+0200) Subject: cec-client: don't display debug output by default in 'cec-client -l' X-Git-Tag: upstream/2.2.0~1^2~22^2^2~36 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=782db5ac5c06dcaeb14b3ce67a55c49888450a7a;p=deb_libcec.git cec-client: don't display debug output by default in 'cec-client -l' --- 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)