Added customizable command log format (Date+Time are now available)

Added the option format to config files (config.yml + worldedit.properties). By default, current date and time are displayed.
The formatting function is implemented by analogy with the class java.util.logging.SimpleFormatter
This commit is contained in:
Qveshn
2018-05-19 18:47:45 +03:00
parent f67f2ed93e
commit f680635ded
8 changed files with 67 additions and 27 deletions

View File

@ -96,7 +96,6 @@ public final class CommandManager {
// Setup the logger
commandLog.addHandler(dynamicHandler);
dynamicHandler.setFormatter(new LogFormat());
// Set up the commands manager
ParametricBuilder builder = new ParametricBuilder();
@ -185,6 +184,8 @@ public final class CommandManager {
} catch (IOException e) {
log.log(Level.WARNING, "Could not use command log file " + path + ": " + e.getMessage());
}
dynamicHandler.setFormatter(new LogFormat(config.logFormat));
}
platform.registerCommands(dispatcher);