package com.cisco.oss.foundation.logging.transactions;

import org.slf4j.Logger;

/**
 * Created by Nuna on 10/01/2016.
 */
public class ReportLogger extends SchedulerLogger {

    public static void start(final Logger logger, final Logger auditor, final String reportName) {
        if(!createLoggingAction(logger, auditor, new ReportLogger())) {
            return;
        }

        ReportLogger reportLogger = (ReportLogger) getInstance();
        if (reportLogger == null) {
            return;
        }

        reportLogger.startInstance(reportName);
    }


    @Override
    protected void addPropertiesStart(String reportName) {
        super.addPropertiesStart("Report", "ReportName", reportName);
    }

    public static void success(String reportBody) {
        ReportLogger logger = (ReportLogger) getInstance();
        if (logger == null) {
            return;
        }

        addProperty("ReportBody", reportBody);

        logger.successInstance();

    }
}

@@ -170,16 +170,375 @@
 gger %7B%0A%0A
+    static private String reportNameFieldName = %22ReportName%22;%0A    static private String reportBodyFieldName = %22ReportBody%22;%0A%0A    static public void  setIvpFieldNames(String reportNameFieldName, String reportBodyFieldName) %7B%0A        ReportLogger.reportNameFieldName = reportNameFieldName;%0A        ReportLogger.reportBodyFieldName = reportBodyFieldName;%0A    %7D%0A%0A
     publ
@@ -620,32 +620,32 @@
 g reportName) %7B%0A
-
         if(!crea
@@ -1036,18 +1036,17 @@
 eport%22, 
-%22R
+r
 eportNam
@@ -1046,17 +1046,25 @@
 portName
-%22
+FieldName
 , report
@@ -1270,18 +1270,17 @@
 roperty(
-%22R
+r
 eportBod
@@ -1280,17 +1280,25 @@
 portBody
-%22
+FieldName
 , report

Allow chaning report field names