package com.eactive.eai.transformer.message.logger;

import com.eactive.eai.common.util.Logger;
import com.eactive.eai.transformer.message.XMLMessage;


public class XMLMessageLogger implements MessageLogger {
    private static Logger logger = Logger.getLogger("transformer");
    private XMLMessage message;

    public XMLMessageLogger(XMLMessage message) {
        this.message = message;
    }

    public void doLog() {
    	logger.info(this.getClass().getName() +
            "> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    	logger.info(this.getClass().getName() +
            "> 현재 기본 구현된 메시지 로거를 사용하고 계십니다.");
    	logger.info(getLogMessage());
    }

    public String getLogMessage(boolean ebcdic) {
        return getLogMessage();
    }

    public String getLogMessage() {
        try {
            return this.message.toLogString();
        } catch (Exception e) {
            throw new RuntimeException(
                "XMLMessageLogger] Cannot make LogMessage. - " +
                e.getMessage());
        }
    }
}
