[FEATURE] In report_to_json: do not output empty dump report, unless specifically requested

This commit is contained in:
hasherezade
2022-11-03 16:20:18 -07:00
parent 1f4564dddb
commit 1613d026d2
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -81,10 +81,10 @@ namespace pesieve {
} t_json_level;
typedef enum {
REPORT_NONE = 0,
REPORT_SCANNED,
REPORT_DUMPED,
REPORT_ALL
REPORT_NONE = 0, ///< do not output a report
REPORT_SCANNED, ///< output the scan report
REPORT_DUMPED, ///< output the dumps report
REPORT_ALL ///< output all available reports
} t_report_type;
//! A wrapper for a dynamically allocated string.
+1 -1
View File
@@ -92,7 +92,7 @@ std::string pesieve::report_to_json(const pesieve::ReportEx& report, const t_rep
stream << "\n";
}
if (rtype == REPORT_ALL || rtype == REPORT_DUMPED) {
if (has_dumps) {
if (has_dumps || rtype == REPORT_DUMPED) { // do not output an empty report, unless requested specifically
OUT_PADDED(stream, level, "\"dump_report\" :\n");
stream << dump_report_to_json(*report.dump_report, jdetails, level);
stream << "\n";