mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 11:26:38 -04:00
Export logs using UTF-8 (#1028)
This commit is contained in:
parent
eebd373aef
commit
beea7d0ae2
@ -20,6 +20,7 @@ package org.jackhuang.hmcl.util;
|
|||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -27,7 +28,6 @@ import java.util.Date;
|
|||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author huangyuhui
|
* @author huangyuhui
|
||||||
*/
|
*/
|
||||||
public final class Logging {
|
public final class Logging {
|
||||||
@ -63,6 +63,11 @@ public final class Logging {
|
|||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
|
streamHandler.setEncoding("UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
streamHandler.setLevel(Level.ALL);
|
streamHandler.setLevel(Level.ALL);
|
||||||
LOG.addHandler(streamHandler);
|
LOG.addHandler(streamHandler);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user