mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-17 07:47:57 -04:00
修复日志文件夹不存在时无法将日志写入文件的问题 (#2984)
This commit is contained in:
parent
32f8ffad46
commit
4104ca082d
@ -210,6 +210,7 @@ public final class Logger {
|
||||
if (logFolder != null) {
|
||||
String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH-mm-ss"));
|
||||
try {
|
||||
Files.createDirectories(logFolder);
|
||||
for (int n = 0; ; n++) {
|
||||
Path file = logFolder.resolve(time + (n == 0 ? "" : "." + n) + ".log").toAbsolutePath().normalize();
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user