mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
feat(logging): enhance log entry handling with truncation and improve upload file naming
This commit is contained in:
@@ -43,7 +43,7 @@ class LogUploadSettingsProvider @Inject constructor(
|
||||
}
|
||||
|
||||
logFiles.forEach { logFile ->
|
||||
val uploadedName = jellyfinApiClient.uploadLogFile(logFile.data)
|
||||
val uploadedName = jellyfinApiClient.uploadLogFile(logFile.contentForUpload())
|
||||
?: error("Log upload failed")
|
||||
PurefinLogger.deleteUploadedFile(logFile)
|
||||
Timber.tag(TAG).d("Uploaded log file ${logFile.name} as $uploadedName and deleted it locally")
|
||||
@@ -51,6 +51,10 @@ class LogUploadSettingsProvider @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun hu.bbara.purefin.core.logging.UploadLogFile.contentForUpload(): String {
|
||||
return "Purefin log upload file: $name\n\n$data"
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val TAG = "LogUploadSettings"
|
||||
const val UPLOAD_LOGS_KEY = "upload_logs"
|
||||
|
||||
Reference in New Issue
Block a user