bug问题:日期格式有空格和冒号,文件夹名API 21下出错

This commit is contained in:
testwind
2025-05-27 17:48:29 +08:00
parent 19538f8044
commit ece9a6c32c

View File

@@ -66,7 +66,7 @@ object LogUtils {
}
}
}
val date = getCurrentDateStr(TIME_PATTERN)
val date = getCurrentDateStr(TIME_PATTERN).replace(" ", "_").replace(":", "-")
val logPath = FileUtils.getPath(root = logFolder, "appLog-$date.txt")
return AsyncFileHandler(logPath).apply {
formatter = object : java.util.logging.Formatter() {