~alecu/ubuntuone-client/config-notifications-2

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/logger.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2011-02-08 20:15:54 UTC
  • mfrom: (796.5.26 fix_runner)
  • Revision ID: tarmac-20110208201554-v8mptkasbj5vzma3
Allow tests to be ran on windows even if they fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
)
35
35
# api compatibility imports
36
36
from ubuntuone import logger
 
37
from ubuntuone.platform import get_filesystem_logger, setup_filesystem_logging
37
38
DebugCapture = logger.DebugCapture
38
39
NOTE = logger.NOTE
39
40
TRACE = logger.TRACE
130
131
root_logger = logging.getLogger("ubuntuone.SyncDaemon")
131
132
twisted_logger = logging.getLogger('twisted')
132
133
 
133
 
# allow pyinotify to configure it's custom logger
134
 
import pyinotify
135
 
# fallback to logging.getLogger(name) to support older versions of pyinotify
136
 
inotify_logger = getattr(pyinotify, 'log', logging.getLogger('pyinotify'))
 
134
filesystem_logger = get_filesystem_logger()
137
135
# now restore our custom logger class
138
136
logging.setLoggerClass(Logger)
139
137
 
166
164
    twisted_logger.addHandler(root_handler)
167
165
    twisted_logger.addHandler(exception_handler)   
168
166
    
169
 
    # hook pyinotify logger, but remove the console handler first
170
 
    for hdlr in inotify_logger.handlers:
171
 
        if isinstance(hdlr, logging.StreamHandler):
172
 
            inotify_logger.removeHandler(hdlr)
173
 
    inotify_logger.addHandler(root_handler)
174
 
    inotify_logger.setLevel(logging.ERROR)
175
 
    inotify_logger.propagate = False
176
 
    
 
167
    # set the filesystem logging    
 
168
    setup_filesystem_logging(filesystem_logger, root_handler)
 
169
 
177
170
    # invalid filenames log
178
171
    invnames_logger = logging.getLogger("ubuntuone.SyncDaemon.InvalidNames")
179
172
    invnames_logger.setLevel(_DEBUG_LOG_LEVEL)