Merge lp:~thisfred/ubuntuone-client/fix-status-logging into lp:ubuntuone-client

Proposed by Eric Casteleijn
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 1044
Merged at revision: 1043
Proposed branch: lp:~thisfred/ubuntuone-client/fix-status-logging
Merge into: lp:ubuntuone-client
Diff against target: 130 lines (+40/-27)
4 files modified
ubuntuone/logger.py (+1/-1)
ubuntuone/platform/linux/messaging.py (+1/-14)
ubuntuone/status/aggregator.py (+2/-12)
ubuntuone/status/logger.py (+36/-0)
To merge this branch: bzr merge lp:~thisfred/ubuntuone-client/fix-status-logging
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
Facundo Batista (community) Approve
Review via email: mp+67057@code.launchpad.net

Commit message

Fixed logging for ubuntuone.status.

Description of the change

Fixed logging for ubuntuone.status.

To post a comment you must log in.
1044. By Eric Casteleijn

removed unused import

Revision history for this message
Facundo Batista (facundo) wrote :

Like it!

review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/logger.py'
--- ubuntuone/logger.py 2010-04-05 14:51:51 +0000
+++ ubuntuone/logger.py 2011-07-06 17:02:37 +0000
@@ -42,7 +42,7 @@
4242
4343
44class Logger(logging.Logger):44class Logger(logging.Logger):
45 """Logger that support out custom levels."""45 """Logger that support our custom levels."""
4646
47 def note(self, msg, *args, **kwargs):47 def note(self, msg, *args, **kwargs):
48 """log at NOTE level"""48 """log at NOTE level"""
4949
=== modified file 'ubuntuone/platform/linux/messaging.py'
--- ubuntuone/platform/linux/messaging.py 2011-04-06 12:50:32 +0000
+++ ubuntuone/platform/linux/messaging.py 2011-07-06 17:02:37 +0000
@@ -22,13 +22,9 @@
22# messages.22# messages.
2323
24import dbus24import dbus
25import os
26import subprocess25import subprocess
27import sys
2826
29from time import time27from time import time
30from ubuntuone.logger import basic_formatter, logging
31
3228
33try:29try:
34 import indicate30 import indicate
@@ -42,19 +38,10 @@
42TRANSLATION_DOMAIN = 'ubuntuone-control-panel'38TRANSLATION_DOMAIN = 'ubuntuone-control-panel'
4339
44from ubuntuone.status.messaging import AbstractMessaging40from ubuntuone.status.messaging import AbstractMessaging
41from ubuntuone.status.logger import logger
4542
46APPLICATION_NAME = 'Ubuntu One Client'43APPLICATION_NAME = 'Ubuntu One Client'
4744
48LOG_LEVEL = logging.DEBUG
49logger = logging.getLogger('ubuntuone.status')
50logger.setLevel(LOG_LEVEL)
51
52if os.environ.get('DEBUG_STATUS'):
53 debug_handler = logging.StreamHandler(sys.stderr)
54 debug_handler.setFormatter(basic_formatter)
55 debug_handler.setLevel(LOG_LEVEL)
56 logger.addHandler(debug_handler)
57
5845
59# pylint: disable=W061346# pylint: disable=W0613
60def open_volumes():47def open_volumes():
6148
=== modified file 'ubuntuone/status/aggregator.py'
--- ubuntuone/status/aggregator.py 2011-06-24 21:37:58 +0000
+++ ubuntuone/status/aggregator.py 2011-07-06 17:02:37 +0000
@@ -20,14 +20,14 @@
20import itertools20import itertools
21import operator21import operator
22import os22import os
23import sys23
2424
25import gettext25import gettext
2626
27from twisted.internet import reactor, defer27from twisted.internet import reactor, defer
2828
29from ubuntuone.clientdefs import GETTEXT_PACKAGE29from ubuntuone.clientdefs import GETTEXT_PACKAGE
30from ubuntuone.logger import basic_formatter, logging30from ubuntuone.status.logger import logger
31from ubuntuone.platform import session31from ubuntuone.platform import session
32from ubuntuone.platform.notification import Notification32from ubuntuone.platform.notification import Notification
33from ubuntuone.platform.messaging import Messaging33from ubuntuone.platform.messaging import Messaging
@@ -36,16 +36,6 @@
36ONE_DAY = 24 * 60 * 6036ONE_DAY = 24 * 60 * 60
37Q_ = lambda string: gettext.dgettext(GETTEXT_PACKAGE, string)37Q_ = lambda string: gettext.dgettext(GETTEXT_PACKAGE, string)
3838
39LOG_LEVEL = logging.DEBUG
40logger = logging.getLogger('ubuntuone.status')
41logger.setLevel(LOG_LEVEL)
42
43if os.environ.get('DEBUG_STATUS'):
44 debug_handler = logging.StreamHandler(sys.stderr)
45 debug_handler.setFormatter(basic_formatter)
46 debug_handler.setLevel(LOG_LEVEL)
47 logger.addHandler(debug_handler)
48
49UBUNTUONE_TITLE = Q_("Ubuntu One")39UBUNTUONE_TITLE = Q_("Ubuntu One")
50NEW_UDFS_SENDER = Q_("New cloud folder(s) available")40NEW_UDFS_SENDER = Q_("New cloud folder(s) available")
51FINAL_COMPLETED = Q_("File synchronization completed.")41FINAL_COMPLETED = Q_("File synchronization completed.")
5242
=== added file 'ubuntuone/status/logger.py'
--- ubuntuone/status/logger.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/status/logger.py 2011-07-06 17:02:37 +0000
@@ -0,0 +1,36 @@
1# ubuntuone.syncdaemon.logger - logging utilities
2#
3# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
4# Eric Casteleijn <eric.casteleijn@canonical.com>
5#
6# Copyright 2009-2011 Canonical Ltd.
7#
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.
11#
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.
16#
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/>.
19""" SyncDaemon logging utilities and config. """
20import logging
21import os
22
23from ubuntuone.logger import (
24 _DEBUG_LOG_LEVEL,
25 LOGFOLDER,
26 CustomRotatingFileHandler,
27 basic_formatter)
28
29
30LOGFILENAME = os.path.join(LOGFOLDER, 'status.log')
31logger = logging.getLogger("ubuntuone.status")
32logger.setLevel(_DEBUG_LOG_LEVEL)
33handler = CustomRotatingFileHandler(filename=LOGFILENAME)
34handler.setFormatter(basic_formatter)
35handler.setLevel(_DEBUG_LOG_LEVEL)
36logger.addHandler(handler)

Subscribers

People subscribed via source and target branches