private static boolean logToConsole = false;
private static java.util.logging.Logger logger;
private static void setupLogging() {
logger = java.util.logging.Logger.getLogger("");
final FileHandler handler = unchecked(() -> new FileHandler(AppDirectory.dir().resolve("log.txt").toString(), true));
handler.setFormatter(new BriefLogFormatter());
logger.addHandler(handler);
if (logToConsole) {
logger.getHandlers()[0].setFormatter(new BriefLogFormatter());
} else {
logger.removeHandler(logger.getHandlers()[0]);
}
}