~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-11 21:57:03 UTC
  • mto: (4896.1.3 2.1.0b4-dev)
  • mto: This revision was merged to the branch mainline in revision 4898.
  • Revision ID: john@arbash-meinel.com-20091211215703-zxl1ygia6mlnvfyo
Get rid of -Dhpssthread, just always include it.

We might actually consider changing mutter() with a -Dlogthread sort of flag.
As it could be useful to have all threads and pids get logged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
            self._thread_id = threading.currentThread().ident
295
295
 
296
296
    def _trace(self, action, message, extra_bytes=None, suppress_time=False):
 
297
        # It is a bit of a shame that this functionality overlaps with that of 
 
298
        # ProtocolThreeRequester._trace. However, there is enough difference
 
299
        # that just putting it in a helper doesn't help a lot. And some state
 
300
        # is taken from the instance.
297
301
        if suppress_time:
298
302
            t = ''
299
303
        else:
300
304
            t = '%5.3fs ' % (osutils.timer_func() - self._request_start_time)
301
 
        if 'hpssthread' in debug.debug_flags:
302
 
            t_info = ' [%s] ' % (self._thread_id,)
303
 
        else:
304
 
            t_info = ' '
305
305
        if extra_bytes is None:
306
306
            extra = ''
307
307
        else:
308
308
            extra = ' ' + repr(extra_bytes[:40])
309
309
            if len(extra) > 33:
310
310
                extra = extra[:29] + extra[-1] + '...'
311
 
        trace.mutter('%12s:%s%s%s%s'
312
 
                     % (action, t_info, t, message, extra))
 
311
        trace.mutter('%12s: [%s] %s%s%s'
 
312
                     % (action, self._thread_id, t, message, extra))
313
313
 
314
314
    def accept_body(self, bytes):
315
315
        """Accept body data."""