@@ -11,16 +11,13 @@ import java.nio.file.Files
1111import java.nio.file.Path
1212import java.time.Duration
1313import kotlin.io.path.fileSize
14- import kotlin.io.path.readLines
15- import kotlin.io.path.writeLines
1614import kotlin.io.path.writeText
1715import kotlin.jvm.optionals.getOrNull
1816
1917class DebugBuilder private constructor(private val uploadServer : String ) {
2018 private val fileToUpload: MutableList <DebugFile > = mutableListOf ()
2119 private var maxPartFileSize: Long = 2_097_152
2220 private var tempPrefix: String = " plugin-debug"
23- private val cleanIpRegex = PRIVACY_REGEX
2421 private var maxZipFileSize: Long = 2_097_152
2522 private var userAgent = " plugin-debug"
2623 private val gson: Gson = Gson ()
@@ -30,16 +27,6 @@ class DebugBuilder private constructor(private val uploadServer: String) {
3027 .setLenient()
3128 .create()
3229
33- @Throws(IllegalStateException ::class )
34- fun enableLatestLogSpigot (): DebugBuilder {
35- val latestLogFile = Path .of(" logs" , " latest.log" )
36- if (latestLogFile.fileSize() >= maxPartFileSize)
37- throw IllegalStateException (" Latest log is to big only {} bytes allowed" .format(maxPartFileSize))
38- val logFile = Files .createTempFile(tempPrefix, " .log" )
39- logFile.writeLines(latestLogFile.readLines().map { it.replace(cleanIpRegex, " *" ) })
40- fileToUpload.add(DebugFile (logFile, FileType .LOG , " Latest Log" ))
41- return this
42- }
4330
4431 fun addFile (file : DebugFile ): DebugBuilder {
4532 fileToUpload.add(file)
0 commit comments