Verified Commit feccc336 authored by Lars Mitsem Selbekk's avatar Lars Mitsem Selbekk
Browse files

Remove unnecessary logging

parent 794dc3d2
Pipeline #175844 failed with stages
in 26 minutes and 1 second
package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.utils.Logger
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.datamodels.ActionData
import se.battlegoo.battlegoose.datamodels.GridVector
import se.battlegoo.battlegoose.datamodels.ScreenVector
......@@ -111,7 +109,6 @@ class BattleController(
placeUnits()
placeObstacles()
battle.yourTurn = random.nextBoolean() xor battle.isHost
Logger(Game.LOGGER_TAG, Logger.INFO).info("Battle ${battle.battleId} playerId: $playerID")
startTurn()
}
......@@ -142,8 +139,6 @@ class BattleController(
private fun startTurn() {
battleMapController.yourTurn = battle.yourTurn
view.yourTurn = battle.yourTurn
Logger(Game.LOGGER_TAG, Logger.INFO)
.info((if (battle.yourTurn) "My" else "Opponent's") + " turn")
applySpells(if (battle.yourTurn) battle.activeSpells.first else battle.activeSpells.second)
if (battle.yourTurn) {
turnStartMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
......
package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.scenes.scene2d.Stage
import com.badlogic.gdx.utils.Logger
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.datamodels.BattleData
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.network.CreateLobbyStatus
......@@ -43,9 +41,7 @@ class CreateLobbyController(
}
fun goBack() {
val lobbyIDCpy = lobbyId
?: return Logger(Game.LOGGER_TAG, Logger.INFO)
.info("Cannot leave lobby before a lobby is created.")
val lobbyIDCpy = lobbyId ?: return
MultiplayerService.deleteLobby(
lobbyIDCpy,
onFail = { str, t ->
......
......@@ -2,8 +2,6 @@ package se.battlegoo.battlegoose.controllers
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.scenes.scene2d.Stage
import com.badlogic.gdx.utils.Logger
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.models.heroes.Hero
import se.battlegoo.battlegoose.network.JoinLobbyStatus
import se.battlegoo.battlegoose.network.MultiplayerService
......@@ -43,7 +41,7 @@ class JoinLobbyController(
private fun goBack() {
val status = joinLobbyStatus
if (status is JoinLobbyStatus.StartBattle)
return Logger(Game.LOGGER_TAG).error("Cannot exit lobby after battle has started")
return
else if (status is JoinLobbyStatus.Ready)
MultiplayerService.leaveLobbyAsOtherPlayer(
status.lobby.lobbyID,
......@@ -83,7 +81,6 @@ class JoinLobbyController(
return
}
Logger(Game.LOGGER_TAG).debug("JoinLobbyStatus: $joinLobbyStatus")
if (joined && joinLobbyStatus is JoinLobbyStatus.NotAccessible
) {
listenForStartingBattle = false
......
package se.battlegoo.battlegoose.models.spells
import com.badlogic.gdx.utils.Logger
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.datamodels.SpellData
import se.battlegoo.battlegoose.models.heroes.Hero
import java.lang.IllegalStateException
import java.lang.Integer.max
abstract class Spell<T : SpellData>(
......@@ -18,7 +15,6 @@ abstract class Spell<T : SpellData>(
fun decreaseCooldown() {
remainingCooldown = max(0, remainingCooldown - 1)
Logger(Game.LOGGER_TAG, Logger.INFO).info("Cooldown now $remainingCooldown")
}
fun cast(caster: Hero, data: T): ActiveSpell<out Spell<T>> {
......
......@@ -146,10 +146,8 @@ object MultiplayerService {
databaseHandler.listen(
DbPath.RandomOpponentQueue,
) { updatedQueueData, queueListenerCanceler ->
Logger(Game.LOGGER_TAG).debug("Run requestOpp listener")
// Create function to leave the queue if wanted
val leaveQueue: LeaveRandomPairingQueue = { onFail, onSuccess ->
Logger(Game.LOGGER_TAG).debug("Trying to leave queue")
processingQueue = true // To not add yourself to queue again
purgeQueue({ str, throwable ->
processingQueue = false
......
......@@ -7,7 +7,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Label
import com.badlogic.gdx.scenes.scene2d.ui.Skin
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.badlogic.gdx.utils.Align
import com.badlogic.gdx.utils.Logger
import se.battlegoo.battlegoose.Game
import se.battlegoo.battlegoose.network.RandomPairingStatus
import se.battlegoo.battlegoose.utils.TextureAsset
......@@ -66,8 +65,6 @@ class QuickJoinView(
is RandomPairingStatus.Failed ->
"Failed to load"
else -> {
Logger(Game.LOGGER_TAG)
.error("RandomPairingStatus '$status' replaced with 'Loading'")
"Loading"
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment