From 7c76b0678adbafdc4f696d6b298f5290f822294e Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Thu, 10 May 2018 08:47:54 -0700 Subject: [PATCH] Log platform info on startup --- data/interfaces/default/configuration_table.html | 2 +- plexpy/__init__.py | 13 ++++++++++++- plexpy/common.py | 6 ++++-- plexpy/http_handler.py | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/data/interfaces/default/configuration_table.html b/data/interfaces/default/configuration_table.html index 5cf50ff1..01df24c6 100644 --- a/data/interfaces/default/configuration_table.html +++ b/data/interfaces/default/configuration_table.html @@ -69,7 +69,7 @@ DOCUMENTATION :: END % endif Platform: - ${common.PLATFORM} ${common.PLATFORM_VERSION} + ${common.PLATFORM} ${common.PLATFROM_RELEASE} (${common.PLATFORM_VERSION + (' - {}'.format(common.PLATFORM_LINUX_DISTRO) if common.PLATFORM_LINUX_DISTRO else '')}) Python Version: diff --git a/plexpy/__init__.py b/plexpy/__init__.py index a5f8f7ab..b6f96619 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -152,6 +152,17 @@ def initialize(config_file): logger.initLogger(console=not QUIET, log_dir=CONFIG.LOG_DIR, verbose=VERBOSE) + logger.info(u"Starting Tautulli {}".format( + common.RELEASE + )) + logger.info(u"{} {} ({}{})".format( + common.PLATFORM, common.PLATFROM_RELEASE, common.PLATFORM_VERSION, + ' - {}'.format(common.PLATFORM_LINUX_DISTRO) if common.PLATFORM_LINUX_DISTRO else '' + )) + logger.info(u"Python {}".format( + sys.version + )) + if not CONFIG.BACKUP_DIR: CONFIG.BACKUP_DIR = os.path.join(DATA_DIR, 'backups') if not os.path.exists(CONFIG.BACKUP_DIR): @@ -1812,7 +1823,7 @@ def initialize_tracker(): 'appVersion': common.RELEASE, 'appId': plexpy.INSTALL_TYPE, 'appInstallerId': plexpy.CONFIG.GIT_BRANCH, - 'dimension1': '{} {}'.format(common.PLATFORM, common.PLATFORM_VERSION), # App Platform + 'dimension1': '{} {}'.format(common.PLATFORM, common.PLATFROM_RELEASE), # App Platform 'userLanguage': plexpy.SYS_LANGUAGE, 'documentEncoding': plexpy.SYS_ENCODING, 'noninteractive': True diff --git a/plexpy/common.py b/plexpy/common.py index fc5db6de..dddfc75a 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -20,11 +20,13 @@ import version # Identify Our Application PLATFORM = platform.system() -PLATFORM_VERSION = platform.release() +PLATFROM_RELEASE = platform.release() +PLATFORM_VERSION = platform.version() +PLATFORM_LINUX_DISTRO = ' '.join(x for x in platform.linux_distribution() if x) BRANCH = version.PLEXPY_BRANCH RELEASE = version.PLEXPY_RELEASE_VERSION -USER_AGENT = 'Tautulli/{} ({} {})'.format(RELEASE, PLATFORM, PLATFORM_VERSION) +USER_AGENT = 'Tautulli/{} ({} {})'.format(RELEASE, PLATFORM, PLATFROM_RELEASE) DEFAULT_USER_THUMB = "interfaces/default/images/gravatar-default-80x80.png" DEFAULT_POSTER_THUMB = "interfaces/default/images/poster.png" diff --git a/plexpy/http_handler.py b/plexpy/http_handler.py index 5010756c..0dcde448 100644 --- a/plexpy/http_handler.py +++ b/plexpy/http_handler.py @@ -43,7 +43,7 @@ class HTTPHandler(object): 'X-Plex-Product': 'Tautulli', 'X-Plex-Version': plexpy.common.RELEASE, 'X-Plex-Platform': plexpy.common.PLATFORM, - 'X-Plex-Platform-Version': plexpy.common.PLATFORM_VERSION, + 'X-Plex-Platform-Version': plexpy.common.PLATFROM_RELEASE, 'X-Plex-Client-Identifier': plexpy.CONFIG.PMS_UUID, }