|
31 | 31 | import sys
|
32 | 32 | import subprocess
|
33 | 33 | import tempfile
|
| 34 | +import logging |
34 | 35 |
|
35 | 36 | import six
|
36 | 37 |
|
37 | 38 | from k5test import _utils
|
38 | 39 |
|
39 | 40 |
|
| 41 | +_LOG = logging.getLogger(__name__) |
| 42 | + |
| 43 | + |
40 | 44 | def _cfg_merge(cfg1, cfg2):
|
41 | 45 | if not cfg2:
|
42 | 46 | return cfg1
|
@@ -167,12 +171,12 @@ def _discover_path(self, name, default, paths):
|
167 | 171 | stderr=stderr_out).strip()
|
168 | 172 | path = path.decode(sys.getfilesystemencoding() or
|
169 | 173 | sys.getdefaultencoding())
|
170 |
| - print("Using discovered path for {name} ({path}".format( |
| 174 | + _LOG.debug("Using discovered path for {name} ({path}".format( |
171 | 175 | name=name, path=path))
|
172 | 176 | return path
|
173 | 177 | except subprocess.CalledProcessError as e:
|
174 | 178 | path = paths.get(name, default)
|
175 |
| - print("Using default path for {name} ({path}): {err}".format( |
| 179 | + _LOG.debug("Using default path for {name} ({path}): {err}".format( |
176 | 180 | name=name, path=path, err=e))
|
177 | 181 | return path
|
178 | 182 |
|
@@ -281,8 +285,8 @@ def run(self, args, env=None, input=None, expected_code=0):
|
281 | 285 | code = proc.returncode
|
282 | 286 | cmd = ' '.join(args)
|
283 | 287 | outstr = outdata.decode()
|
284 |
| - print('[OUTPUT FROM `{args}`]\n{output}\n'.format(args=cmd, |
285 |
| - output=outstr)) |
| 288 | + _LOG.debug('[OUTPUT FROM `{args}`]\n{output}\n'.format(args=cmd, |
| 289 | + output=outstr)) |
286 | 290 | if code != expected_code:
|
287 | 291 | raise Exception("Unexpected return code "
|
288 | 292 | "for command `{args}`: {code}".format(args=cmd,
|
@@ -315,8 +319,8 @@ def _start_daemon(self, args, env, sentinel):
|
315 | 319 | 'with code {code}'.format(args=cmd,
|
316 | 320 | code=code))
|
317 | 321 | else:
|
318 |
| - print('[OUTPUT FROM `{args}`]\n' |
319 |
| - '{output}\n'.format(args=cmd, output=line)) |
| 322 | + _LOG.debug('[OUTPUT FROM `{args}`]\n' |
| 323 | + '{output}\n'.format(args=cmd, output=line)) |
320 | 324 |
|
321 | 325 | if sentinel in line:
|
322 | 326 | break
|
|
0 commit comments