Permalink
Browse files

more print -> xbmc.log() to keep debug log clean

  • Loading branch information...
1 parent 971a48f commit 30e7e553e99639a335a48a9597a12927ec8d3ed5 @amet amet committed Mar 27, 2012
Showing with 14 additions and 12 deletions.
  1. +1 −0 script.xbmc.boblight/resources/lib/boblight.py
  2. +13 −12 script.xbmc.boblight/resources/lib/settings.py
@@ -42,6 +42,7 @@
import xbmc
import sys
import os
+from tools import log
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
__settings__ = sys.modules[ "__main__" ].__settings__
@@ -26,6 +26,7 @@
sys.path.append (__cwd__)
from boblight import *
+from tools import log
#general
global g_networkaccess
@@ -246,19 +247,19 @@ def settings_handleNetworkSettings():
#we need to reconnect if networkaccess bool changes
#or if network access is enabled and ip or port have changed
if g_networkaccess != networkaccess or ((g_hostip != hostip or g_hostport != hostport) and g_networkaccess) :
- print "boblight: changed networkaccess to " + str(networkaccess)
+ log("boblight: changed networkaccess to " + str(networkaccess))
g_networkaccess = networkaccess
if not networkaccess:
g_hostip = None
g_hostport = -1
else:
if g_hostip != hostip:
- print "boblight: changed hostip to " + str(hostip)
+ log("boblight: changed hostip to " + str(hostip))
g_hostip = hostip
if g_hostport != hostport:
- print "boblight: changed hostport to " + str(hostport)
+ log("boblight: changed hostport to " + str(hostport))
g_hostport = hostport
reconnect = True
return reconnect
@@ -312,37 +313,37 @@ def settings_handleGlobalSettings(category):
if g_saturation != saturation:
ret = bob_setoption("saturation " + str(saturation))
settingChanged = True
- print "boblight: changed saturation to " + str(saturation) + "(ret " + str(ret) + ")"
+ log("boblight: changed saturation to " + str(saturation) + "(ret " + str(ret) + ")")
g_saturation = saturation
if g_value != value:
ret = bob_setoption("value " + str(value))
settingChanged = True
- print "boblight: changed value to " + str(value) + "(ret " + str(ret) + ")"
+ log("boblight: changed value to " + str(value) + "(ret " + str(ret) + ")")
g_value = value
if g_speed != speed:
ret = bob_setoption("speed " + str(speed))
settingChanged = True
- print "boblight: changed speed to " + str(speed) + "(ret " + str(ret) + ")"
+ log("boblight: changed speed to " + str(speed) + "(ret " + str(ret) + ")")
g_speed = speed
if g_autospeed != autospeed:
ret = bob_setoption("autospeed " + str(autospeed))
settingChanged = True
- print "boblight: changed autospeed to " + str(autospeed) + "(ret " + str(ret) + ")"
+ log("boblight: changed autospeed to " + str(autospeed) + "(ret " + str(ret) + ")")
g_autospeed = autospeed
if g_interpolation != interpolation:
ret = bob_setoption("interpolation " + str(interpolation))
settingChanged = True
- print "boblight: changed interpolation to " + str(interpolation) + "(ret " + str(ret) + ")"
+ log("boblight: changed interpolation to " + str(interpolation) + "(ret " + str(ret) + ")")
g_interpolation = interpolation
if g_threshold != threshold:
ret = bob_setoption("threshold " + str(threshold))
settingChanged = True
- print "boblight: changed threshold to " + str(threshold) + "(ret " + str(ret) + ")"
+ log("boblight: changed threshold to " + str(threshold) + "(ret " + str(ret) + ")")
g_threshold = threshold
return settingChanged
@@ -355,7 +356,7 @@ def settings_handleCategory(category):
if g_category != category:
categoryChanged = True #don't change notify when category changes
- print "boblight: use settings for " + category
+ log("boblight: use settings for " + category)
g_category = category
return categoryChanged
@@ -370,9 +371,9 @@ def settings_handleDisableSetting():
if bobdisable:
text = __settings__.getLocalizedString(503)
xbmc.executebuiltin("XBMC.Notification(%s,%s,%s,%s)" % (__scriptname__,text,10,__icon__))
- print "boblight: boblight disabled"
+ log("boblight: boblight disabled")
else:
- print "boblight: boblight enabled"
+ log("boblight: boblight enabled")
g_bobdisable = bobdisable
#handles all settings of boblight and applies them as needed

0 comments on commit 30e7e55

Please sign in to comment.