Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加CachedFileWriter日志 #2451 #2452

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class CachedFileWriter(
}
} catch (ignore: FileAlreadyExistsException) {
// 如果目录或者文件已存在则忽略
logger.info("initial temp file $tempFilePath failed: ${ignore.message}")
} catch (exception: Exception) {
logger.error("initial CacheFileWriter error: $exception", exception)
close()
Expand All @@ -92,6 +93,7 @@ class CachedFileWriter(
it.write(i)
} catch (ignored: Exception) {
// ignored
logger.info("write data to temp file $tempFilePath failed: ${ignored.message}")
close()
}
}
Expand All @@ -103,6 +105,7 @@ class CachedFileWriter(
it.write(buffer, off, length)
} catch (ignored: Exception) {
// ignored
logger.info("write data to temp file $tempFilePath failed: ${ignored.message}")
close()
}
}
Expand Down Expand Up @@ -172,12 +175,13 @@ class CachedFileWriter(
if (!cacheFilePath.existReal()) {
Files.move(tempFilePath, cacheFilePath)
listener?.onCacheFileWritten(filename, cacheFilePath)
logger.info("Success cache file $filename")
logger.info("Success cache file $filename, move temp file $tempFilePath to cache file $cacheFilePath")
}
} catch (ignore: FileAlreadyExistsException) {
logger.info("File[$cacheFilePath] already exists")
} catch (exception: Exception) {
logger.error("Finish CacheFileWriter error: $exception", exception)
logger.error("Finish CacheFileWriter error, " +
"move temp file $tempFilePath to cache file $cacheFilePath: $exception", exception)
}
}

Expand Down
Loading