All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.timefold.solver.python.logging.PythonDelegateAppender Maven / Gradle / Ivy

Go to download

Timefold solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the core implementation of the Python solver.

There is a newer version: 1.14.0
Show newest version
package ai.timefold.solver.python.logging;

import java.util.function.Consumer;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;

public class PythonDelegateAppender extends AppenderBase {
    private static Consumer logEventConsumer;

    public static void setLogEventConsumer(Consumer logEventConsumer) {
        PythonDelegateAppender.logEventConsumer = logEventConsumer;
    }

    @Override
    protected void append(ILoggingEvent eventObject) {
        logEventConsumer.accept(
                new PythonLoggingEvent(
                        PythonLogLevel.fromJavaLevel(eventObject.getLevel()),
                        eventObject.getFormattedMessage()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy