DebugUtil.java

package sidplay.player;

import libsidplay.sidtune.SidTune;
import libsidutils.prg2tap.PRG2TAP;

import java.io.IOException;
import java.util.logging.LogManager;
import java.util.logging.Logger;

public class DebugUtil {

    private static final String LOG_CONFIG_RESOURCE = "/sidplay/logconfig.properties";

    public static void init() {
        try {
            // turn off HSQL logging re-configuration
            System.setProperty("hsqldb.reconfig_logging", "false");
            // configure JSIDPlay2 logging (java util logging)
            LogManager.getLogManager().readConfiguration(DebugUtil.class.getResourceAsStream(LOG_CONFIG_RESOURCE));
        } catch (final IOException | NullPointerException e) {
            Logger.getAnonymousLogger().severe("Could not load " + LOG_CONFIG_RESOURCE + ": " + e.getMessage());
        }
        // assemble PSID driver code at runtime (optionally in the classpath)
        try {
            Class.forName("kickass.KickAssembler");
            SidTune.USE_KICKASSEMBLER = true;
            PRG2TAP.USE_KICKASSEMBLER = true;
        } catch (ClassNotFoundException ignored) {
        }
    }

}