Commit 6fba34d0 authored by maruel@chromium.org's avatar maruel@chromium.org

Add input_api.logging.

This makes it possible to dump logging information from a PRESUBMIT script when
calling git cl presubmit -v -v -v for example.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7027031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87603 0039d316-1c4b-4281-b951-d872f2087c98
parent 607bb1b2
......@@ -600,6 +600,8 @@ def RunPylint(input_api, output_api, white_list=None, black_list=None):
# were listed, try to run pylint.
try:
from pylint import lint
input_api.logging.debug(
'Using pylint v%s from %s' % (lint.version, lint.__file__))
except ImportError:
if input_api.platform == 'win32':
return [output_api.PresubmitNotifyResult(
......
......@@ -243,6 +243,7 @@ class InputApi(object):
self.cPickle = cPickle
self.cStringIO = cStringIO
self.json = json
self.logging = logging.getLogger('PRESUBMIT')
self.os_listdir = os.listdir
self.os_walk = os.walk
self.os_path = os.path
......
......@@ -793,7 +793,8 @@ class InputApiUnittest(PresubmitTestsBase):
'LocalToDepotPath',
'PresubmitLocalPath', 'ReadFile', 'RightHandSideLines', 'ServerPaths',
'basename', 'cPickle', 'cStringIO', 'canned_checks', 'change', 'environ',
'host_url', 'is_committing', 'json', 'marshal', 'os_listdir', 'os_walk',
'host_url', 'is_committing', 'json', 'logging', 'marshal', 'os_listdir',
'os_walk',
'os_path', 'owners_db', 'pickle', 'platform', 'python_executable', 're',
'rietveld', 'subprocess', 'tbr', 'tempfile', 'time', 'traceback',
'unittest', 'urllib2', 'version', 'verbose',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment