Skip to content

Commit bc38a5f

Browse files
committed
Remove bukkit specific code
1 parent 165643a commit bc38a5f

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

src/main/kotlin/net/onelitefeather/plugindebug/DebugBuilder.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ import java.nio.file.Files
1111
import java.nio.file.Path
1212
import java.time.Duration
1313
import kotlin.io.path.fileSize
14-
import kotlin.io.path.readLines
15-
import kotlin.io.path.writeLines
1614
import kotlin.io.path.writeText
1715
import kotlin.jvm.optionals.getOrNull
1816

1917
class 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

Comments
 (0)