Add log_only to debug messages (#25545)

Fixes #25544
When `debug` is enabled the debug messages triggered
from `bin/ansible-connection` should be logged only to file
and not on stdout.
This commit is contained in:
Ganesh Nalawade 2017-06-13 18:41:33 +05:30 committed by GitHub
commit 9e8cc26720
3 changed files with 7 additions and 6 deletions

View file

@ -174,9 +174,9 @@ class Display:
def vvvvvv(self, msg, host=None):
return self.verbose(msg, host=host, caplevel=5)
def debug(self, msg):
def debug(self, msg, log_only=False):
if C.DEFAULT_DEBUG:
self.display("%6d %0.5f: %s" % (os.getpid(), time.time(), msg), color=C.COLOR_DEBUG)
self.display("%6d %0.5f: %s" % (os.getpid(), time.time(), msg), color=C.COLOR_DEBUG, log_only=log_only)
def verbose(self, msg, host=None, caplevel=2):
if self.verbosity > caplevel: