package org.apache.logging.log4j.core;

import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.PolyNull;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.TimeUnit;
import java.util.EventListener;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.ConfigurationListener;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.apache.logging.log4j.core.config.LocationAwareReliabilityStrategy;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.apache.logging.log4j.core.config.NullConfiguration;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.config.Reconfigurable;
import org.apache.logging.log4j.core.config.ReliabilityStrategy;
import org.apache.logging.log4j.core.filter.CompositeFilter;
import org.apache.logging.log4j.core.impl.ContextDataInjectorFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.impl.ThreadContextDataInjector;
import org.apache.logging.log4j.core.impl.ThrowableProxy;
import org.apache.logging.log4j.core.jmx.Server;
import org.apache.logging.log4j.core.layout.ByteBufferDestination;
import org.apache.logging.log4j.core.layout.Encoder;
import org.apache.logging.log4j.core.time.Instant;
import org.apache.logging.log4j.core.time.MutableInstant;
import org.apache.logging.log4j.core.util.Cancellable;
import org.apache.logging.log4j.core.util.ExecutorServices;
import org.apache.logging.log4j.core.util.NetUtils;
import org.apache.logging.log4j.core.util.ShutdownCallbackRegistry;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogBuilder;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.MessageFactory;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.spi.AbstractLogger;
import org.apache.logging.log4j.spi.LoggerContextFactory;
import org.apache.logging.log4j.spi.LoggerContextShutdownAware;
import org.apache.logging.log4j.spi.LoggerContextShutdownEnabled;
import org.apache.logging.log4j.spi.LoggerRegistry;
import org.apache.logging.log4j.spi.Terminable;
import org.apache.logging.log4j.spi.ThreadContextMapFactory;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.ThreadContext.ContextStack;
import org.apache.logging.log4j.util.Constants;
import org.apache.logging.log4j.util.EnglishEnums;
import org.apache.logging.log4j.util.PropertiesUtil;
import org.apache.logging.log4j.util.ReadOnlyStringMap;
import org.apache.logging.log4j.util.StringMap;
import org.apache.logging.log4j.util.Strings;
import org.apache.logging.log4j.util.Supplier;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.PolyNull;
import static org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.SHUTDOWN_HOOK_MARKER;

public class AbstractLifeCycle implements LifeCycle2 {
    protected boolean equalsImpl(final @Nullable Object obj);
    protected boolean stop(final @Nullable Future<?> future);
}

public abstract class AbstractLogEvent implements LogEvent {
    public @Nullable ReadOnlyStringMap getContextData();
    public @Nullable Level getLevel();
    public @Nullable String getLoggerFqcn();
    public @Nullable String getLoggerName();
    public @Nullable Marker getMarker();
    public @Nullable Message getMessage();
    public @Nullable StackTraceElement getSource();
    public @Nullable String getThreadName();
    public @Nullable Throwable getThrown();
    public @Nullable ThrowableProxy getThrownProxy();
}

public interface Appender extends LifeCycle {
    @Nullable String getName();
    @Nullable Layout<? extends Serializable> getLayout();
}

public interface ContextDataInjector {
    StringMap injectContextData(final @Nullable List<Property> properties, final StringMap reusable);
}

public class Core {
}

public class DefaultLoggerContextAccessor implements LoggerContextAccessor {
}

public interface ErrorHandler {
}

public interface Filter extends LifeCycle {
    enum Result {
        ACCEPT,
        NEUTRAL,
        DENY;

        public static @PolyNull Result toResult(final @PolyNull String name);
    }

    Result filter(Logger logger, Level level, @Nullable Marker marker, String msg, Object @Nullable ... params);
    Result filter(Logger logger, Level level, @Nullable Marker marker, String message, Object p0);
    Result filter(Logger logger, Level level, @Nullable Marker marker, String message, Object p0, Object p1);
    Result filter(Logger logger, Level level, @Nullable Marker marker, String message, Object p0, Object p1, Object p2);
    Result filter(
            Logger logger, Level level, @Nullable Marker marker, String message, Object p0, Object p1, Object p2, Object p3);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4,
            Object p5);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4,
            Object p5,
            Object p6);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4,
            Object p5,
            Object p6,
            Object p7);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4,
            Object p5,
            Object p6,
            Object p7,
            Object p8);
    Result filter(
            Logger logger,
            Level level,
            @Nullable Marker marker,
            String message,
            Object p0,
            Object p1,
            Object p2,
            Object p3,
            Object p4,
            Object p5,
            Object p6,
            Object p7,
            Object p8,
            Object p9);
    Result filter(Logger logger, Level level, @Nullable Marker marker, Object msg, @Nullable Throwable t);
    Result filter(Logger logger, Level level, @Nullable Marker marker, Message msg, @Nullable Throwable t);
    default Result filter(Logger logger, Level level, @Nullable Marker marker, String msg);
}

public interface Layout<T extends Serializable> extends Encoder<LogEvent> {
}

public interface LifeCycle {
    enum State {
        INITIALIZING,
        INITIALIZED,
        STARTING,
        STARTED,
        STOPPING,
        STOPPED
    }
}

public interface LifeCycle2 extends LifeCycle {
}

public interface LogEvent extends Serializable {
    @Nullable String getLoggerName();
    @Nullable Marker getMarker();
    @Nullable StackTraceElement getSource();
    @Nullable String getThreadName();
    @Nullable Throwable getThrown();
    @Nullable ThrowableProxy getThrownProxy();
}

public class LogEventListener implements EventListener {
    public void log(final @Nullable LogEvent event);
}

public class Logger extends AbstractLogger implements Supplier<LoggerConfig> {
    private final @Nullable LoggerContext context;
    public @Nullable Logger getParent();
    public synchronized void setLevel(final @Nullable Level level);
    public void logMessage(
            final String fqcn, final Level level, final @Nullable Marker marker, final @Nullable Message message, final Throwable t);
    protected void log(
            final Level level,
            final @Nullable Marker marker,
            final String fqcn,
            final StackTraceElement location,
            final Message message,
            final Throwable throwable);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final String message, final Throwable t);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final String message);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final String message, final Object... params);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final String message, final Object p0);
    public boolean isEnabled(
            final Level level, final @Nullable Marker marker, final String message, final Object p0, final Object p1);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4,
            final Object p5);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4,
            final Object p5,
            final Object p6);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4,
            final Object p5,
            final Object p6,
            final Object p7);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4,
            final Object p5,
            final Object p6,
            final Object p7,
            final Object p8);
    public boolean isEnabled(
            final Level level,
            final @Nullable Marker marker,
            final String message,
            final Object p0,
            final Object p1,
            final Object p2,
            final Object p3,
            final Object p4,
            final Object p5,
            final Object p6,
            final Object p7,
            final Object p8,
            final Object p9);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final CharSequence message, final Throwable t);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final Object message, final Throwable t);
    public boolean isEnabled(final Level level, final @Nullable Marker marker, final Message message, final Throwable t);

    protected class PrivateConfig {
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final String msg);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final String msg, final Throwable t);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final String msg, final Object... p1);
        boolean filter(final Level level, final @Nullable Marker marker, final String msg, final Object p0);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final String msg, final Object p0, final Object p1);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4,
                final Object p5);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4,
                final Object p5,
                final Object p6);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4,
                final Object p5,
                final Object p6,
                final Object p7);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4,
                final Object p5,
                final Object p6,
                final Object p7,
                final Object p8);
        boolean filter(
                final @Nullable Level level,
                final @Nullable Marker marker,
                final String msg,
                final Object p0,
                final Object p1,
                final Object p2,
                final Object p3,
                final Object p4,
                final Object p5,
                final Object p6,
                final Object p7,
                final Object p8,
                final Object p9);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final CharSequence msg, final Throwable t);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final Object msg, final Throwable t);
        boolean filter(final @Nullable Level level, final @Nullable Marker marker, final Message msg, final Throwable t);
    }
    public boolean equals(final @Nullable Object o);
}

public class LoggerContext extends AbstractLifeCycle
        implements org.apache.logging.log4j.spi.LoggerContext,
                AutoCloseable,
                Terminable,
                ConfigurationListener,
                LoggerContextShutdownEnabled {
    public LoggerContext(final String name, final @Nullable Object externalContext);
    public LoggerContext(final String name, final @Nullable Object externalContext, final @Nullable URI configLocn);
    public LoggerContext(final String name, final @Nullable Object externalContext, final @Nullable String configLocn);
    public static LoggerContext getContext(
            final @Nullable ClassLoader loader, final boolean currentContext, final URI configLocation);
    public void setExternalContext(final @Nullable Object context);
    public Logger getLogger(final String name, final @Nullable MessageFactory messageFactory);
    public @Nullable URI getConfigLocation();
}

public interface LoggerContextAccessor {
}

public interface StringLayout extends Layout<String> {
}

public class Version {
}
