From 8cd4cb903e1f3ab3bfbab02f7a23fcd3f90c8aee Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 21 Aug 2016 16:28:26 -0500 Subject: [PATCH] Add logging Prevent error in event profiling modules are not part of the standard python library --- resources/lib/utils.py | 7 ++++--- service.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 18a74b8e..9d38e710 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -2,11 +2,10 @@ ################################################################################################# -import cProfile + import inspect import json import logging -import pstats import sqlite3 import StringIO import os @@ -288,7 +287,9 @@ def profiling(sortby="cumulative"): # Will print results to Kodi log def decorator(func): def wrapper(*args, **kwargs): - + import cProfile + import pstats + pr = cProfile.Profile() pr.enable() diff --git a/service.py b/service.py index d70dd2b4..dbdfa414 100644 --- a/service.py +++ b/service.py @@ -67,6 +67,7 @@ class Service(): # Initial logging log.warn("======== START %s ========" % self.addonName) + log.warn("Python Version: %s", sys.version) log.warn("Platform: %s" % (self.clientInfo.getPlatform())) log.warn("KODI Version: %s" % xbmc.getInfoLabel('System.BuildVersion')) log.warn("%s Version: %s" % (self.addonName, self.clientInfo.getVersion()))