/*
 * Decompiled with CFR 0.152.
 */
package org.jivesoftware.smack.debugger;

import java.io.Reader;
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.debugger.AbstractDebugger;

public class ConsoleDebugger
extends AbstractDebugger {
    private final SimpleDateFormat dateFormatter = new SimpleDateFormat("hh:mm:ss aaa");

    public ConsoleDebugger(XMPPConnection connection, Writer writer, Reader reader) {
        super(connection, writer, reader);
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    @Override
    protected void log(String logMessage) {
        String formatedDate;
        SimpleDateFormat simpleDateFormat = this.dateFormatter;
        synchronized (simpleDateFormat) {
            formatedDate = this.dateFormatter.format(new Date());
        }
        System.out.println(formatedDate + ' ' + logMessage);
    }
}
