Move views to python logging

This commit is contained in:
Sunil Mohan Adapa 2014-07-05 21:28:43 +02:00
parent 1e4deb7bb9
commit 431a585636

View File

@ -20,11 +20,15 @@ Main Plinth views
"""
from django.http.response import HttpResponseRedirect
import logging
import cfg
from withsqlite.withsqlite import sqlite_db
LOGGER = logging.getLogger(__name__)
def index(request):
"""Serve the main index page"""
# TODO: Move firstboot handling to firstboot module somehow
@ -36,7 +40,7 @@ def index(request):
return HttpResponseRedirect(cfg.server_dir + '/firstboot')
if database['state'] < 5:
cfg.log('First boot state = %d' % database['state'])
LOGGER.info('First boot state - %d', database['state'])
return HttpResponseRedirect(
cfg.server_dir + '/firstboot/state%d' % database['state'])