483bcd4ae3a13f3028ceb95b8b1a1863f327166a
[jamaendo] / jamaui / __init__.py
1 #!/usr/bin/env python
2 #
3 # This file is part of Jamaendo.
4 # Copyright (c) 2010 Kristoffer Gronlund
5 #
6 # Jamaendo is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Jamaendo is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Jamaendo.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # Player code heavily based on http://thpinfo.com/2008/panucci/:
20 #  A resuming media player for Podcasts and Audiobooks
21 #  Copyright (c) 2008-05-26 Thomas Perl <thpinfo.com>
22 #  (based on http://pygstdocs.berlios.de/pygst-tutorial/seeking.html)
23 #
24
25 import logging
26 import sys
27
28 LOG_FILENAME = '/tmp/jamaendo.log'
29 LOG_LEVEL = logging.INFO
30 LOG_FORMAT = "%(asctime)s %(name)-10s: [%(lineno)4d] %(levelname)-5s %(message)s"
31
32 _rootlogger = logging.getLogger()
33 _fhandler = logging.FileHandler(LOG_FILENAME, mode='w')
34 _shandler = logging.StreamHandler()
35 _formatter = logging.Formatter(LOG_FORMAT)
36 _fhandler.setFormatter(_formatter)
37 _shandler.setFormatter(_formatter)
38
39 _rootlogger.addHandler(_fhandler)
40 _rootlogger.addHandler(_shandler)
41 _rootlogger.setLevel(LOG_LEVEL)
42