package org.xbib.logging.ext.test.formatters;

import org.xbib.logging.ExtLogRecord;
import org.xbib.logging.ExtLogRecord.FormatStyle;
import org.xbib.logging.ext.test.MapTestUtils;

abstract class AbstractTest extends MapTestUtils {

    ExtLogRecord createLogRecord(final String msg) {
        return createLogRecord(org.xbib.logging.Level.INFO, msg);
    }

    ExtLogRecord createLogRecord(final String format, final Object... args) {
        return createLogRecord(org.xbib.logging.Level.INFO, format, args);
    }

    private ExtLogRecord createLogRecord(final org.xbib.logging.Level level, final String msg) {
        return new ExtLogRecord(level, msg, getClass().getName());
    }

    ExtLogRecord createLogRecord(final org.xbib.logging.Level level, final String format, final Object... args) {
        final ExtLogRecord record = new ExtLogRecord(level, format, FormatStyle.PRINTF, getClass().getName());
        record.setParameters(args);
        return record;
    }

}
