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

org.jboss.windup.decompiler.fernflower.FernflowerJDKLogger Maven / Gradle / Ivy

There is a newer version: 6.3.9.Final
Show newest version
package org.jboss.windup.decompiler.fernflower;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.jetbrains.java.decompiler.main.extern.IFernflowerLogger;

/**
 * @author Jesse Sightler
 */
public class FernflowerJDKLogger extends IFernflowerLogger
{
    private static Logger LOG = Logger.getLogger(FernflowerDecompiler.class.getName());

    @Override
    public void writeMessage(String s, Severity severity)
    {
        LOG.log(getLevel(severity), s);
    }

    @Override
    public void writeMessage(String s, Throwable throwable)
    {
        LOG.log(Level.SEVERE, "Error decompiling due to: " + throwable.getMessage(), throwable);
    }

    private Level getLevel(Severity severity)
    {
        switch (severity)
        {
        case TRACE:
            return Level.FINE;
        case INFO:
            return Level.INFO;
        case WARN:
            return Level.WARNING;
        case ERROR:
            return Level.SEVERE;
        default:
            return Level.INFO;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy