MonitoringPlugin: Multiline verbose output, cleanup

This commit is contained in:
Sven Velt 2021-09-22 12:05:10 +02:00
parent 97d6a3669e
commit af6b9daf16

View file

@ -361,12 +361,12 @@ class MonitoringPlugin(object):
bol = 'V' + str(level) + ':' + ' ' * level
if prefix:
bol += '%s' % prefix
if type(output) in [str, str, ]:
print((bol + output))
if type(output) in [str, ]:
print(bol + output.lstrip().rstrip().replace('\n', '\n' + bol))
elif type(output) in [list, ]:
print(('\n'.join( ['%s%s' % (bol, l) for l in output] ) ))
print('\n'.join( ['%s%s' % (bol, l) for l in output] ) )
else:
print(('%s%s' % (bol, output) ))
print('%s%s' % (bol, output) )
def max_returncode(self, returncodes):