Seagate / openSeaChest_LogParser

Open source version of the Log Parser that parses ATA/SCSI/NVMe & Seagate vendor unique logs
Mozilla Public License 2.0
6 stars 1 forks source link

No --outputLog now prints correct printType output to stdout #6

Closed natanlidukhover closed 4 years ago

natanlidukhover commented 4 years ago

Running openSeaChest_LogParser without the --outputLog flag is intended to print the output to the screen. However, previously, running openSeaChest_LogParser without --outputLog would print the output in JSON format, regardless of whether or not a different print type (e.g. CSV or Text) was specified with --printType. Meanwhile, the correct format was set to a file with a .jsn file extension (even if the print type differed).

For example, running the LogParser with a CSV print type but no outputLog would result in JSON output being printed to the screen (stdout) and CSV output being sent to a .jsn file. The following image illustrates this. openSeaChest_LogParser-output_bug-csv

The desired output for such a situation would be CSV output printed to stdout (rather than JSON) and to a .csv file (rather than .jsn). My changes result in the following situation. openSeaChest_LogParser-output_bug-csv

A similar situation could occur with the Prom print type. Currently, with --printType prom, JSON is printed to stdout, and Prom output is sent to a .jsn file. openSeaChest_LogParser-output_bug-prom

My changes result in Prom printed to stdout and sent to a .prom file. openSeaChest_LogParser-output_bug-prom

JSON is still used as the default if no print type is specified (just as before), so if JSON is specified as the print type or the argument is omitted, JSON is printed to stdout and to a .json file. The only difference is that the file extension was changed to .json, which is the proper extension according to the RFC 8259 internet standard. openSeaChest_LogParser-output_bug-default

Swiss3003 commented 4 years ago

closing issue