view src/sat.tac @ 991:05e02f8b7eb4

core: logging refactoring, first step: - added a core.log module - 3 backends can be used: basic, standard (python's logging module) or twisted - colors can be used - the module has been made to be used by frontends, it should work in exotic environments like pyjamas - logging basic configuration is now made in sat.tac - core.log configuration is inspired from python standard logging, and use it when possible - getLogger should be used the same way as for standard logging
author Goffi <goffi@goffi.org>
date Sat, 19 Apr 2014 00:02:38 +0200
parents 1fe00f0c9a91
children 652c01ca69b1
line wrap: on
line source

#!/usr/bin/python
# -*- coding: utf-8 -*-

# SAT: a jabber client
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jérôme Poisson (goffi@goffi.org)

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from twisted.application import service
from twisted.internet import glib2reactor
glib2reactor.install()

from sat.core.constants import Const as C
from sat.core import log
log.configure(C.LOG_BACKEND_TWISTED)

from sat.core.sat_main import SAT

application = service.Application('SàT')
service = SAT()
service.setServiceParent(application)