mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
more debug logs for free, network_cli, paramiko and add hostname context to debugging messages (#39205)
* Add hostname context to debugging messages * Set paramiko's channel
This commit is contained in:
parent
f91d961cb4
commit
bbfe7a8b2f
4 changed files with 30 additions and 11 deletions
|
@ -191,9 +191,12 @@ class Display:
|
|||
def vvvvvv(self, msg, host=None):
|
||||
return self.verbose(msg, host=host, caplevel=5)
|
||||
|
||||
def debug(self, msg):
|
||||
def debug(self, msg, host=None):
|
||||
if C.DEFAULT_DEBUG:
|
||||
self.display("%6d %0.5f: %s" % (os.getpid(), time.time(), msg), color=C.COLOR_DEBUG)
|
||||
if host is None:
|
||||
self.display("%6d %0.5f: %s" % (os.getpid(), time.time(), msg), color=C.COLOR_DEBUG)
|
||||
else:
|
||||
self.display("%6d %0.5f [%s]: %s" % (os.getpid(), time.time(), host, msg), color=C.COLOR_DEBUG)
|
||||
|
||||
def verbose(self, msg, host=None, caplevel=2):
|
||||
if self.verbosity > caplevel:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue