Skip to content

Commit

Permalink
Changed CADF output format to use one-line JSON
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed Nov 22, 2019
1 parent 401def8 commit c8d300f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zhmc_log_forwarder/zhmc_log_forwarder.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
SELF_LOGGER_NAME = CMD_NAME
SELF_LOGGER = None # Will be initialized in main()

# Indent for JSON output to CADF (None=oneline)
CADF_JSON_INDENT = None


try:
textwrap.indent
except AttributeError: # undefined function (wasn't added until Python 3.3)
Expand Down Expand Up @@ -1013,7 +1017,7 @@ def output_entries(self, log_entries):
"reasonCode": row.id,
}
}
out_str = json.dumps(out_dict, indent=4)
out_str = json.dumps(out_dict, indent=CADF_JSON_INDENT)

dest = self.fwd_parms['dest']
if dest in ('stdout', 'stderr'):
Expand Down

0 comments on commit c8d300f

Please sign in to comment.