Added support for varying log levels configurable in the server config (see log_level in default.conf)

Error logs now properly print to stderr when possible
Colour-coded logs
Addressed a scenario in which outgoing packet writes could get hung up
Fixed interface incorrect definition message on server startup
This commit is contained in:
Ceikry
2023-03-01 08:01:14 +00:00
committed by Ryan
parent e1faa64af7
commit 88a2f354b4
171 changed files with 723 additions and 475 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import core.net.IoSession
import core.net.packet.IoBuffer
import org.rs09.consts.Items
import core.ServerConstants
import core.api.log
import core.game.shops.Shop
import core.game.shops.ShopItem
import core.tools.SystemLogger
@@ -18,6 +19,7 @@ import core.game.system.config.ServerConfigParser
import core.game.world.GameWorld
import core.game.world.repository.Repository
import core.game.world.update.UpdateSequence
import core.tools.Log
import java.net.URI
import java.nio.ByteBuffer
@@ -66,7 +68,7 @@ object TestUtils {
}
fun advanceTicks(amount: Int, skipPulseUpdates: Boolean = true) {
SystemLogger.logInfo(this::class.java, "Advancing ticks by $amount.")
log(this::class.java, Log.FINE, "Advancing ticks by $amount.")
for(i in 0 until amount) {
GameWorld.majorUpdateWorker.handleTickActions(skipPulseUpdates)
}
@@ -4,7 +4,9 @@ import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import core.ServerConstants
import core.api.log
import core.auth.UserAccountInfo
import core.tools.Log
import core.tools.SystemLogger
import java.sql.SQLDataException
@@ -20,9 +22,9 @@ class SQLStorageProviderTests {
}
@AfterAll @JvmStatic fun cleanup() {
SystemLogger.logInfo(this::class.java, "Cleaning up unit test accounts")
log(this::class.java, Log.FINE, "Cleaning up unit test accounts")
testAccountNames.forEach {name ->
SystemLogger.logInfo(this::class.java, "Removing test account $name")
log(this::class.java, Log.FINE, "Removing test account $name")
val info = UserAccountInfo.createDefault()
info.username = name
storage.remove(info)