/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-11 21:51:44 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-20091211215144-ml4x175u6mwyhc13
Add a -Dhpssthread debug flag to include thread.ident info.

I'm thinking to just go back and always include it. I don't feel like it
adds a lot of clutter, and then we don't have to worry about a new flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1143
1143
        self.response_sent = False
1144
1144
        self._headers = {'Software version': bzrlib.__version__}
1145
1145
        if 'hpss' in debug.debug_flags:
1146
 
            import threading
1147
1146
            self._thread_id = threading.currentThread().ident
1148
1147
            self._response_start_time = None
1149
1148
 
1154
1153
            t = ''
1155
1154
        else:
1156
1155
            t = '%5.3fs ' % (time.clock() - self._response_start_time)
 
1156
        if 'hpssthread' in debug.debug_flags:
 
1157
            t_info = ' [%s] ' % (self._thread_id,)
 
1158
        else:
 
1159
            t_info = ' '
1157
1160
        if extra_bytes is None:
1158
1161
            extra = ''
1159
1162
        else:
1160
1163
            extra = ' ' + repr(extra_bytes[:40])
1161
1164
            if len(extra) > 33:
1162
1165
                extra = extra[:29] + extra[-1] + '...'
1163
 
        mutter('%12s: [%s] %s%s%s'
1164
 
               % (action, self._thread_id, t, message, extra))
 
1166
        mutter('%12s:%s%s%s%s'
 
1167
               % (action, t_info, t, message, extra))
1165
1168
 
1166
1169
    def send_error(self, exception):
1167
1170
        if self.response_sent: