/**
* 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;
}
Globals.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:Code-Glosser
作者:
评论列表
文章目录