Skip to content

Commit

Permalink
remove log spam for release
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-klein committed Apr 25, 2018
1 parent 549baee commit 25d7bf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resources/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'''
This module contains various helper functions used thoughout the addon
'''
#TODO: create a global IN_DEVELOPMENT variable to enable/disable various features

import xbmc
import xbmcaddon
Expand All @@ -23,14 +24,16 @@ def wrapper(*args, **kwargs):
return func(*new_args, **new_kwargs)
return wrapper

def log_msg(msg, loglevel=xbmc.LOGNOTICE):
def log_msg(msg, loglevel=xbmc.LOGDEBUG):
''' log message with addon name and version to kodi log '''
if isinstance(msg, unicode):
msg = msg.encode('utf-8')
xbmc.log("{0} v{1} --> {2}".format(STR_ADDON_NAME, STR_ADDON_VER, msg), level=loglevel)

def log_decorator(func):
''' decorator for logging function call and return values '''
#TODO: option to have "pre-" and "post-" logging
#TODO: fix iterating output when string (Synced.localize_type)
def wrapper(*args, **kwargs):
''' function wrapper '''
# call the function and get the return value
Expand Down

0 comments on commit 25d7bf1

Please sign in to comment.