Skip to content

Commit

Permalink
add file logger write lock
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXiaoM committed Mar 27, 2024
1 parent 45adbcf commit 22a8d61
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ internal class LoggerInFolder @JvmOverloads constructor(
internal class WithFileLogger(
val logger: MiraiLogger,
file: File
) : MiraiLogger, PlatformLogger(logger.identity, { file.appendText(it + "\n") }, false) {
) : MiraiLogger, PlatformLogger(logger.identity, {
synchronized(logger) {
file.appendText(it + "\n")
}
}, false) {
// Implementation notes v2.5.0:
// Extending `PlatformLogger` for binary compatibility for JVM target only.
// See actual declaration in androidMain for a better impl (implements `MiraiLogger` only)
Expand Down

0 comments on commit 22a8d61

Please sign in to comment.