~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

[merge] jelmer

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
 
192
192
    _stderr_handler = logging.StreamHandler()
193
193
    _stderr_handler.setFormatter(QuietFormatter())
194
 
 
195
 
    if not _file_handler:
196
 
        open_tracefile()
 
194
    logging.getLogger('').addHandler(_stderr_handler)
197
195
 
198
196
    if os.environ.get('BZR_DEBUG'):
199
197
        level = logging.DEBUG
201
199
        level = logging.INFO
202
200
 
203
201
    _stderr_handler.setLevel(logging.INFO)
204
 
    _file_handler.setLevel(level)
 
202
 
 
203
    if not _file_handler:
 
204
        open_tracefile()
 
205
 
 
206
    if _file_handler:
 
207
        _file_handler.setLevel(level)
 
208
 
205
209
    _bzr_logger.setLevel(level) 
206
210
 
207
 
    logging.getLogger('').addHandler(_stderr_handler)
208
 
 
209
 
 
210
211
def disable_default_logging():
211
212
    """Turn off default log handlers.
212
213