1
# ubuntuone.syncdaemon.logger - logging utilities
3
# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
4
# Eric Casteleijn <eric.casteleijn@canonical.com>
6
# Copyright 2009-2011 Canonical Ltd.
8
# This program is free software: you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License version 3, as published
10
# by the Free Software Foundation.
12
# This program is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranties of
14
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
# PURPOSE. See the GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License along
18
# with this program. If not, see <http://www.gnu.org/licenses/>.
20
"""SyncDaemon logging utilities and config."""
25
from ubuntuone.logger import (
28
CustomRotatingFileHandler,
31
from ubuntuone.platform.xdg_base_directory import ubuntuone_log_dir
34
LOGFILENAME = os.path.join(ubuntuone_log_dir, 'status.log')
35
logger = logging.getLogger("ubuntuone.status")
36
logger.setLevel(_DEBUG_LOG_LEVEL)
37
handler = CustomRotatingFileHandler(filename=LOGFILENAME)
38
handler.setFormatter(basic_formatter)
39
handler.setLevel(_DEBUG_LOG_LEVEL)
40
logger.addHandler(handler)