package cz.senslog.connector.push.logger;

import cz.senslog.connector.model.config.DefaultConfig;
import cz.senslog.connector.model.logger.LoggerModel;
import cz.senslog.connector.push.api.ConnectorPushProvider;
import cz.senslog.connector.push.api.ConnectorPusher;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class ConnectorPushPushProvider implements ConnectorPushProvider {

    private static final Logger logger = LogManager.getLogger(ConnectorPushPushProvider.class);

    @Override
    public ConnectorPusher<LoggerModel> createPusher(DefaultConfig config) {
        return new ConnectorPusher<LoggerModel>() {
            @Override
            public void init() {}

            @Override
            public void push(LoggerModel model) {
                logger.info("Pushing model: {}", model);
            }
        };
    }
}