mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
add logger statement for number of events
This commit is contained in:
parent
8d19555cf1
commit
e814f28039
@ -886,6 +886,12 @@ class BaseTask(LogErrorsTask):
|
||||
try:
|
||||
stdout_handle.flush()
|
||||
stdout_handle.close()
|
||||
# If stdout_handle was wrapped with event filter, log data
|
||||
if hasattr(stdout_handle, '_event_ct'):
|
||||
logger.info('%s finished running, producing %s events.',
|
||||
instance.log_format, stdout_handle._event_ct)
|
||||
else:
|
||||
logger.info('%s finished running', instance.log_format)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
@ -818,6 +818,7 @@ class OutputEventFilter(object):
|
||||
def __init__(self, fileobj=None, event_callback=None, raw_callback=None):
|
||||
self._fileobj = fileobj
|
||||
self._event_callback = event_callback
|
||||
self._event_ct = 0
|
||||
self._raw_callback = raw_callback
|
||||
self._counter = 1
|
||||
self._start_line = 0
|
||||
@ -872,6 +873,7 @@ class OutputEventFilter(object):
|
||||
self._start_line += n_lines
|
||||
if self._event_callback:
|
||||
self._event_callback(event_data)
|
||||
self._event_ct += 1
|
||||
|
||||
if next_event_data.get('uuid', None):
|
||||
self._current_event_data = next_event_data
|
||||
|
Loading…
Reference in New Issue
Block a user