// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.logger.backend;

import java.util.logging.Level;
import com.hypixel.hytale.logger.HytaleLogger;

public class HytaleUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler
{
    public static final HytaleUncaughtExceptionHandler INSTANCE;
    
    public static void setup() {
        Thread.setDefaultUncaughtExceptionHandler(HytaleUncaughtExceptionHandler.INSTANCE);
        System.setProperty("java.util.concurrent.ForkJoinPool.common.exceptionHandler", HytaleUncaughtExceptionHandler.class.getName());
    }
    
    @Override
    public void uncaughtException(final Thread t, final Throwable e) {
        HytaleLogger.getLogger().at(Level.SEVERE).withCause(e).log("Exception in thread: %s", t);
    }
    
    static {
        INSTANCE = new HytaleUncaughtExceptionHandler();
    }
}
