package com.ctrip.ops.sysdev.decoders;

import lombok.extern.log4j.Log4j;
import org.apache.log4j.Logger;
import org.joda.time.DateTime;
import org.json.simple.JSONValue;

import java.util.HashMap;
import java.util.Map;

@Log4j
public class JsonDecoder implements Decode {

    public Map<String, Object> decode(final String message) {
        Map<String, Object> event = null;
        try {
            event = (HashMap) JSONValue.parseWithException(message);
        } catch (Exception e) {
            log.warn("failed to json parse message to event",e);
        } finally {
            log.warn("event converted to a json message which has message and timestamp fields");
            if (event == null) {
                event = createDefaultEvent(message);
            }
            return event;
        }
    }
}

@@ -502,20 +502,21 @@
     log.
-warn
+debug
 (%22failed
@@ -548,16 +548,17 @@
  event%22,
+ 
 e);%0A    
@@ -577,106 +577,8 @@
 y %7B%0A
-            log.warn(%22event converted to a json message which has message and timestamp fields%22);%0A
     

remove log.warn