Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: gclient_utils.py

Issue 14874005: Use logger formatting instead of string interpolation. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic utils.""" 5 """Generic utils."""
6 6
7 import codecs 7 import codecs
8 import logging 8 import logging
9 import os 9 import os
10 import Queue 10 import Queue
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 self.kwargs = kwargs 738 self.kwargs = kwargs
739 self.daemon = True 739 self.daemon = True
740 740
741 def run(self): 741 def run(self):
742 """Runs in its own thread.""" 742 """Runs in its own thread."""
743 logging.debug('_Worker.run(%s)' % self.item.name) 743 logging.debug('_Worker.run(%s)' % self.item.name)
744 work_queue = self.kwargs['work_queue'] 744 work_queue = self.kwargs['work_queue']
745 try: 745 try:
746 self.item.run(*self.args, **self.kwargs) 746 self.item.run(*self.args, **self.kwargs)
747 except KeyboardInterrupt: 747 except KeyboardInterrupt:
748 logging.info('Caught KeyboardInterrupt in thread %s' % self.item.name) 748 logging.info('Caught KeyboardInterrupt in thread %s', self.item.name)
749 logging.info(str(sys.exc_info())) 749 logging.info(str(sys.exc_info()))
750 work_queue.exceptions.put(sys.exc_info()) 750 work_queue.exceptions.put(sys.exc_info())
751 raise 751 raise
752 except Exception: 752 except Exception:
753 # Catch exception location. 753 # Catch exception location.
754 logging.info('Caught exception in thread %s' % self.item.name) 754 logging.info('Caught exception in thread %s', self.item.name)
755 logging.info(str(sys.exc_info())) 755 logging.info(str(sys.exc_info()))
756 work_queue.exceptions.put(sys.exc_info()) 756 work_queue.exceptions.put(sys.exc_info())
757 finally: 757 finally:
758 logging.info('_Worker.run(%s) done' % self.item.name) 758 logging.info('_Worker.run(%s) done', self.item.name)
759 work_queue.ready_cond.acquire() 759 work_queue.ready_cond.acquire()
760 try: 760 try:
761 work_queue.ready_cond.notifyAll() 761 work_queue.ready_cond.notifyAll()
762 finally: 762 finally:
763 work_queue.ready_cond.release() 763 work_queue.ready_cond.release()
764 764
765 765
766 def GetEditor(git, git_editor=None): 766 def GetEditor(git, git_editor=None):
767 """Returns the most plausible editor to use. 767 """Returns the most plausible editor to use.
768 768
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 868
869 Python on OSX 10.6 raises a NotImplementedError exception. 869 Python on OSX 10.6 raises a NotImplementedError exception.
870 """ 870 """
871 try: 871 try:
872 import multiprocessing 872 import multiprocessing
873 return multiprocessing.cpu_count() 873 return multiprocessing.cpu_count()
874 except: # pylint: disable=W0702 874 except: # pylint: disable=W0702
875 # Mac OS 10.6 only 875 # Mac OS 10.6 only
876 # pylint: disable=E1101 876 # pylint: disable=E1101
877 return int(os.sysconf('SC_NPROCESSORS_ONLN')) 877 return int(os.sysconf('SC_NPROCESSORS_ONLN'))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698