mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 18:26:15 +00:00
add GA logging to main and service base calls
This commit is contained in:
parent
e9be0ae64a
commit
64766bcb71
3 changed files with 15 additions and 2 deletions
11
default.py
11
default.py
|
@ -22,6 +22,7 @@ sys.path.append(_BASE_LIB)
|
|||
import entrypoint
|
||||
import loghandler
|
||||
from utils import window, dialog, language as lang
|
||||
from ga_client import GoogleAnalytics
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -156,5 +157,13 @@ class Main(object):
|
|||
if __name__ == "__main__":
|
||||
|
||||
log.info("plugin.video.emby started")
|
||||
Main()
|
||||
|
||||
try:
|
||||
Main()
|
||||
except Exception as error:
|
||||
ga = GoogleAnalytics()
|
||||
errStrings = ga.formatException()
|
||||
ga.sendEventData("Exception", errStrings[0], errStrings[1])
|
||||
log.exception(error)
|
||||
|
||||
log.info("plugin.video.emby stopped")
|
||||
|
|
|
@ -11,7 +11,7 @@ log = logging.getLogger("EMBY."+__name__)
|
|||
|
||||
class GoogleAnalytics():
|
||||
|
||||
testing = True
|
||||
testing = False
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ sys.path.append(_BASE_LIB)
|
|||
import loghandler
|
||||
from service_entry import Service
|
||||
from utils import settings
|
||||
from ga_client import GoogleAnalytics
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -41,6 +42,9 @@ if __name__ == "__main__":
|
|||
# Start the service
|
||||
service.service_entry_point()
|
||||
except Exception as error:
|
||||
ga = GoogleAnalytics()
|
||||
errStrings = ga.formatException()
|
||||
ga.sendEventData("Exception", errStrings[0], errStrings[1])
|
||||
log.exception(error)
|
||||
log.info("Forcing shutdown")
|
||||
service.shutdown()
|
||||
|
|
Loading…
Reference in a new issue