Merge lp:~chipaca/ubuntuone-client/fix-u1frefs-logging into lp:ubuntuone-client

Proposed by John Lenton
Status: Merged
Approved by: John O'Brien
Approved revision: 438
Merged at revision: not available
Proposed branch: lp:~chipaca/ubuntuone-client/fix-u1frefs-logging
Merge into: lp:ubuntuone-client
Diff against target: 32 lines (+9/-5)
1 file modified
bin/ubuntuone-preferences (+9/-5)
To merge this branch: bzr merge lp:~chipaca/ubuntuone-client/fix-u1frefs-logging
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
dobey (community) Approve
Review via email: mp+21597@code.launchpad.net

Commit message

Fix the logging in ubuntuone-preferences to work correctly

Description of the change

A very small branch that applies suggestions by verterok as to how to get logging working with minimal fuss. fixes #540466.

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
John O'Brien (jdobrien) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/ubuntuone-preferences'
--- bin/ubuntuone-preferences 2010-03-17 13:53:37 +0000
+++ bin/ubuntuone-preferences 2010-03-17 21:52:41 +0000
@@ -32,7 +32,8 @@
32from oauth import oauth32from oauth import oauth
33from ubuntuone import clientdefs33from ubuntuone import clientdefs
34from ubuntuone.syncdaemon.tools import SyncDaemonTool34from ubuntuone.syncdaemon.tools import SyncDaemonTool
35from ubuntuone.syncdaemon.logger import LOGFOLDER35from ubuntuone.syncdaemon.logger import (basic_formatter, LOGFOLDER,
36 CustomRotatingFileHandler)
3637
37import logging38import logging
38import httplib, urlparse, socket39import httplib, urlparse, socket
@@ -41,11 +42,14 @@
41from dbus.exceptions import DBusException42from dbus.exceptions import DBusException
42from dbus.mainloop.glib import DBusGMainLoop43from dbus.mainloop.glib import DBusGMainLoop
4344
44logging.basicConfig(
45 filename=os.path.join(LOGFOLDER, 'u1-prefs.log'),
46 level=logging.DEBUG,
47 format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
48logger = logging.getLogger("ubuntuone-preferences")45logger = logging.getLogger("ubuntuone-preferences")
46logger.setLevel(logging.DEBUG)
47handler = CustomRotatingFileHandler(filename=os.path.join(LOGFOLDER,
48 'u1-prefs.log'))
49handler.setFormatter(basic_formatter)
50handler.setLevel(logging.DEBUG)
51logger.addHandler(handler)
52
49DBusGMainLoop(set_as_default=True)53DBusGMainLoop(set_as_default=True)
5054
51_ = gettext.gettext55_ = gettext.gettext

Subscribers

People subscribed via source and target branches