Globals.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:Code-Glosser 作者:
/**
 * Initializes all globals to a default state. Used so that in the case of a
 * memory leak, the previous values are not accidentally used.
 */
public static void initGlobals() {
    System.setProperty("java.util.logging.SimpleFormatter.format", 
        "(%1$tc) [%4$s] ~%2$s~%nMessage: \"%5$s\"%n");
    try {
        handler = new FileHandler("log.txt");
        handler.setLevel(Level.INFO);
        handler.setFormatter(new SimpleFormatter());

        // Ensure we only log to log file.
        LOGGER.setUseParentHandlers(false);
        LOGGER.addHandler(handler);

        LOGGER.setLevel(Level.INFO);
    } catch (IOException | SecurityException ex) {
        throw new RuntimeException("Failed to initialized logger... " + ex.getMessage());
    }
    PROJECT_FOLDER = null;
    URI_PREFIX = null;
    CURRENT_FILE = null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号