[FIX] Фикс двойных логов

This commit is contained in:
Gravit 2019-02-17 18:37:52 +07:00
parent 64b1e9cff0
commit cffaed6de8
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -50,7 +50,7 @@ public enum OutputTypes
PLAIN, JANSI, HTML PLAIN, JANSI, HTML
} }
private static final Set<OutputEnity> OUTPUTS = Collections.newSetFromMap(new ConcurrentHashMap<>(2)); private static final Set<OutputEnity> OUTPUTS = Collections.newSetFromMap(new ConcurrentHashMap<>(2));
private static final Output STD_OUTPUT; private static final OutputEnity STD_OUTPUT;
private LogHelper() { private LogHelper() {
} }
@ -240,7 +240,7 @@ public static void printLicense(String product) {
} }
@LauncherAPI @LauncherAPI
public static boolean removeOutput(Output output) { public static boolean removeOutput(OutputEnity output) {
return OUTPUTS.remove(output); return OUTPUTS.remove(output);
} }
@ -397,8 +397,8 @@ private static String formatLicense(String product) {
JANSI = jansi; JANSI = jansi;
// Add std writer // Add std writer
STD_OUTPUT = System.out::println; STD_OUTPUT = new OutputEnity(System.out::println, JANSI ? OutputTypes.JANSI : OutputTypes.PLAIN);
addOutput(STD_OUTPUT, JANSI ? OutputTypes.JANSI : OutputTypes.PLAIN); addOutput(STD_OUTPUT);
// Add file log writer // Add file log writer
String logFile = System.getProperty("launcher.logFile"); String logFile = System.getProperty("launcher.logFile");