libcec: Make verbose logging optional
authorpopcornmix <popcornmix@gmail.com>
Sun, 18 May 2014 17:08:22 +0000 (18:08 +0100)
committerpopcornmix <popcornmix@gmail.com>
Sun, 18 May 2014 17:40:52 +0000 (18:40 +0100)
language/English/strings.po
xbmc/commons/ilog.h
xbmc/peripherals/devices/PeripheralCecAdapter.cpp
xbmc/settings/AdvancedSettings.cpp

index 951bfcb..fb26ead 100755 (executable)
@@ -2866,7 +2866,12 @@ msgctxt "#678"
 msgid "Verbose logging for UPnP components"
 msgstr ""
 
-#empty strings from id 679 to 699
+#: xbmc/settings/AdvancedSettings.cpp
+msgctxt "#679"
+msgid "Verbose logging for CEC library"
+msgstr ""
+
+#empty strings from id 680 to 699
 
 msgctxt "#700"
 msgid "Cleaning up library"
index 03ccc7d..4bf5d83 100644 (file)
@@ -52,6 +52,7 @@
 #define LOGAUDIO    (1 << (LOGMASKBIT + 7))
 #define LOGAIRTUNES (1 << (LOGMASKBIT + 8))
 #define LOGUPNP     (1 << (LOGMASKBIT + 9))
+#define LOGCEC      (1 << (LOGMASKBIT + 10))
 
 #ifdef __GNUC__
 #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4)))
index db7bb2a..6cd952d 100644 (file)
@@ -33,6 +33,7 @@
 #include "peripherals/Peripherals.h"
 #include "peripherals/bus/PeripheralBus.h"
 #include "pictures/GUIWindowSlideShow.h"
+#include "settings/AdvancedSettings.h"
 #include "settings/Settings.h"
 #include "utils/log.h"
 #include "utils/Variant.h"
@@ -1181,7 +1182,7 @@ int CPeripheralCecAdapter::CecLogMessage(void *cbParam, const cec_log_message me
     break;
   }
 
-  if (iLevel >= 0)
+  if (iLevel >= CEC_LOG_NOTICE || (iLevel >= 0 && g_advancedSettings.CanLogComponent(LOGCEC)))
     CLog::Log(iLevel, "%s - %s", __FUNCTION__, message.message);
 
   return 1;
index 342299c..6835504 100644 (file)
@@ -1391,6 +1391,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se
 #ifdef HAS_UPNP
   list.push_back(std::make_pair(g_localizeStrings.Get(678), LOGUPNP));
 #endif
+#ifdef HAVE_LIBCEC
+  list.push_back(std::make_pair(g_localizeStrings.Get(679), LOGCEC));
+#endif
 }
 
 void CAdvancedSettings::setExtraLogLevel(const std::vector<CVariant> &components)