mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
adding display to plugins and start moving debug to display
This commit is contained in:
parent
5d51f3abda
commit
851ed45bbf
20 changed files with 152 additions and 109 deletions
|
@ -24,6 +24,8 @@ import os
|
|||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from multiprocessing import Lock
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError
|
||||
|
@ -44,6 +46,7 @@ class Display:
|
|||
self.cowsay = None
|
||||
self.noncow = os.getenv("ANSIBLE_COW_SELECTION",None)
|
||||
self.set_cowsay_info()
|
||||
#self.debug_lock = Lock()
|
||||
|
||||
def set_cowsay_info(self):
|
||||
|
||||
|
@ -102,6 +105,14 @@ class Display:
|
|||
def vvvvvv(self, msg, host=None):
|
||||
return self.verbose(msg, host=host, caplevel=5)
|
||||
|
||||
def debug(self, msg):
|
||||
if C.DEFAULT_DEBUG:
|
||||
# FIXME: enable when display is inherited to all
|
||||
#self.debug_lock.acquire()
|
||||
self.display("%6d %0.5f: %s" % (os.getpid(), time.time(), msg), color='dark gray')
|
||||
sys.stdout.flush()
|
||||
#self.debug_lock.release()
|
||||
|
||||
def verbose(self, msg, host=None, caplevel=2):
|
||||
# FIXME: this needs to be implemented
|
||||
#msg = utils.sanitize_output(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue