Skip to content

Commit

Permalink
fix: crash caused by file log
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
  • Loading branch information
NextAlone committed Apr 12, 2024
1 parent 9ef68be commit 0a78e2d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ object Log {
private fun writeToFile(level: Level, tag: String?, msg: String) {
CoroutineScope(Dispatchers.IO).launch {
runCatching {
async {
if (logFile.readAttributes().size() > 1024 * 1024 * 10) { // 10MB
synchronized(logFile) {
if (!logFile.exists() || logFile.readAttributes().size() > 1024 * 1024 * 10) { // 10MB
refreshLog()
}
}
Expand Down

0 comments on commit 0a78e2d

Please sign in to comment.