From 588e3a62bd085a839ed7fd3a70cb0d73046e08f1 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 5 Jul 2014 21:27:53 +0200 Subject: [PATCH] Move pagekite module to python logging --- modules/pagekite/pagekite.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/pagekite/pagekite.py b/modules/pagekite/pagekite.py index 506f98432..9856f9da1 100644 --- a/modules/pagekite/pagekite.py +++ b/modules/pagekite/pagekite.py @@ -27,11 +27,15 @@ from django.template import RequestContext from django.template.loader import render_to_string from django.template.response import TemplateResponse from gettext import gettext as _ +import logging import actions import cfg +LOGGER = logging.getLogger(__name__) + + def init(): """Intialize the PageKite module""" menu = cfg.main_menu.find('/apps') @@ -130,7 +134,6 @@ def get_status(): # Check if PageKite is installed output = _run(['get-installed']) - cfg.log('Output - %s' % output) if output.split()[0] != 'installed': return None @@ -155,7 +158,7 @@ def get_status(): def _apply_changes(request, old_status, new_status): """Apply the changes to PageKite configuration""" - cfg.log.info('New status is - %s' % new_status) + LOGGER.info('New status is - %s', new_status) if old_status != new_status: _run(['stop']) @@ -194,8 +197,7 @@ def _run(arguments, superuser=True): """Run an given command and raise exception if there was an error""" command = 'pagekite-configure' - cfg.log.info('Running command - %s, %s, %s' % (command, arguments, - superuser)) + LOGGER.info('Running command - %s, %s, %s', command, arguments, superuser) if superuser: output, error = actions.superuser_run(command, arguments)