mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-08 19:35:36 -04:00
* update * update --------- Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
parent
af3719403d
commit
96471e3a92
@ -111,13 +111,14 @@ public final class Logger {
|
||||
}
|
||||
}
|
||||
|
||||
private void onShutdown() {
|
||||
private void onExit() {
|
||||
shutdown();
|
||||
try {
|
||||
loggerThread.join();
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
|
||||
String caller = CLASS_NAME + ".onShutdown";
|
||||
String caller = CLASS_NAME + ".onExit";
|
||||
|
||||
if (logRetention > 0 && logFile != null) {
|
||||
List<Pair<Path, int[]>> list = new ArrayList<>();
|
||||
@ -258,7 +259,7 @@ public final class Logger {
|
||||
loggerThread.setName("HMCL Logger Thread");
|
||||
loggerThread.start();
|
||||
|
||||
Thread cleanerThread = new Thread(this::onShutdown);
|
||||
Thread cleanerThread = new Thread(this::onExit);
|
||||
cleanerThread.setName("HMCL Logger Shutdown Hook");
|
||||
Runtime.getRuntime().addShutdownHook(cleanerThread);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user