diff --git a/build-logic/src/main/kotlin/terasology-metrics.gradle.kts b/build-logic/src/main/kotlin/terasology-metrics.gradle.kts index 0b3a3b28810..5734decfc71 100644 --- a/build-logic/src/main/kotlin/terasology-metrics.gradle.kts +++ b/build-logic/src/main/kotlin/terasology-metrics.gradle.kts @@ -25,13 +25,13 @@ dependencies { pmd("net.sourceforge.pmd:pmd-core:7.0.0-rc4") pmd("net.sourceforge.pmd:pmd-java:7.0.0-rc4") - testRuntimeOnly("ch.qos.logback:logback-classic:1.2.11") { + testRuntimeOnly("ch.qos.logback:logback-classic:1.2.12") { because("runtime: to configure logging during tests with logback.xml") } testRuntimeOnly("org.codehaus.janino:janino:3.1.7") { because("allows use of EvaluatorFilter in logback.xml") } - testRuntimeOnly("org.slf4j:jul-to-slf4j:1.7.36") { + testRuntimeOnly("org.slf4j:jul-to-slf4j:2.0.9") { because("redirects java.util.logging (from e.g. junit) through slf4j") } diff --git a/build-logic/src/main/kotlin/terasology-module.gradle.kts b/build-logic/src/main/kotlin/terasology-module.gradle.kts index cd0c27f5494..661c4186eaf 100644 --- a/build-logic/src/main/kotlin/terasology-module.gradle.kts +++ b/build-logic/src/main/kotlin/terasology-module.gradle.kts @@ -75,7 +75,7 @@ if (project.name == "ModuleTestingEnvironment") { dependencies { // MTE is a special snowflake, it gets these things as non-test dependencies implementation(group = "org.terasology.engine", name = "engine-tests", version = moduleMetadata.engineVersion()) - implementation("ch.qos.logback:logback-classic:1.2.3") + implementation("ch.qos.logback:logback-classic:1.2.12") runtimeOnly("org.codehaus.janino:janino:3.1.3") { because("logback filters") } diff --git a/engine-tests/build.gradle b/engine-tests/build.gradle index 6074a4d785c..8b7ecb4464a 100644 --- a/engine-tests/build.gradle +++ b/engine-tests/build.gradle @@ -62,11 +62,11 @@ dependencies { implementation("org.terasology.joml-ext:joml-test:0.1.0") - implementation('org.slf4j:slf4j-api:1.7.36') { + implementation('org.slf4j:slf4j-api:2.0.9') { because('a backend-independent Logger') } - testImplementation("ch.qos.logback:logback-classic:1.2.11") { + testImplementation("ch.qos.logback:logback-classic:1.4.11") { because("implementation: a test directly uses logback.classic classes") } diff --git a/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/Engines.java b/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/Engines.java index 2239cfdae38..3ca81f2a0c4 100644 --- a/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/Engines.java +++ b/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/Engines.java @@ -259,7 +259,7 @@ TerasologyEngine createHost(NetworkMode hostNetworkMode) throws IOException { doneLoading = false; host.subscribeToStateChange(() -> { GameState newState = host.getState(); - logger.debug("New engine state is {}", host.getState()); + logger.debug("New engine state is {}", newState); if (newState instanceof StateIngame) { hostContext = newState.getContext(); if (hostContext == null) { diff --git a/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/IntegrationEnvironmentSubsystem.java b/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/IntegrationEnvironmentSubsystem.java index 001745d17c8..823685e1797 100644 --- a/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/IntegrationEnvironmentSubsystem.java +++ b/engine-tests/src/main/java/org/terasology/engine/integrationenvironment/IntegrationEnvironmentSubsystem.java @@ -78,7 +78,7 @@ static void registerCurrentDirectoryIfModule(ModuleManager moduleManager) { logger.info("Install path does not appear to be a module: {}", installPath); } } catch (IOException e) { - logger.warn("Could not read install path as module at " + installPath); + logger.warn("Could not read install path as module at {}", installPath); } } } diff --git a/engine/build.gradle b/engine/build.gradle index 48f7303f833..ff31f17b122 100644 --- a/engine/build.gradle +++ b/engine/build.gradle @@ -115,10 +115,10 @@ dependencies { implementation group: 'de.matthiasmann.twl', name: 'PNGDecoder', version: '1111' // Logging - implementation('org.slf4j:slf4j-api:1.7.36') { + implementation('org.slf4j:slf4j-api:2.0.9') { because('a backend-independent Logger') } - implementation("ch.qos.logback:logback-classic:1.2.11") { + implementation("ch.qos.logback:logback-classic:1.2.12") { because("telemetry implementation uses logback to send to logstash " + "and we bundle org.terasology.logback for the regex filter") } @@ -133,7 +133,7 @@ dependencies { implementation(group: 'com.snowplowanalytics', name: 'snowplow-java-tracker', version: '0.12.1') { exclude group: 'org.slf4j', module: 'slf4j-simple' } - implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '7.2' + implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '7.4' // Our developed libs api group: 'org.terasology.gestalt', name: 'gestalt-asset-core', version: '7.2.0-SNAPSHOT' diff --git a/engine/src/main/java/org/terasology/engine/config/RenderingDebugConfig.java b/engine/src/main/java/org/terasology/engine/config/RenderingDebugConfig.java index 14a2d1c540d..ec86b76a588 100644 --- a/engine/src/main/java/org/terasology/engine/config/RenderingDebugConfig.java +++ b/engine/src/main/java/org/terasology/engine/config/RenderingDebugConfig.java @@ -108,6 +108,6 @@ public void setRenderSkeletons(boolean renderSkeletons) { @Override public void propertyChange(PropertyChangeEvent evt) { - logger.info("Set {} property to {}. ", evt.getPropertyName().toUpperCase(), evt.getNewValue()); // for debugging purposes + logger.debug("Set {} property to {}.", evt.getPropertyName().toUpperCase(), evt.getNewValue()); } } diff --git a/engine/src/main/java/org/terasology/engine/core/TerasologyEngine.java b/engine/src/main/java/org/terasology/engine/core/TerasologyEngine.java index 7e989e34910..0c81dce849e 100644 --- a/engine/src/main/java/org/terasology/engine/core/TerasologyEngine.java +++ b/engine/src/main/java/org/terasology/engine/core/TerasologyEngine.java @@ -266,7 +266,7 @@ private void verifyInitialisation() { * Logs software, environment and hardware information. */ private void logEnvironmentInfo() { - logger.info(TerasologyVersion.getInstance().toString()); + logger.info("{}", TerasologyVersion.getInstance()); logger.info("Home path: {}", PathManager.getInstance().getHomePath()); logger.info("Install path: {}", PathManager.getInstance().getInstallPath()); logger.info("Java: {} in {}", System.getProperty("java.version"), System.getProperty("java.home")); diff --git a/engine/src/main/java/org/terasology/engine/core/modes/StateLoading.java b/engine/src/main/java/org/terasology/engine/core/modes/StateLoading.java index 8b3e4d35b6f..d26f9619fb2 100644 --- a/engine/src/main/java/org/terasology/engine/core/modes/StateLoading.java +++ b/engine/src/main/java/org/terasology/engine/core/modes/StateLoading.java @@ -234,7 +234,7 @@ private void popStep() { current = null; if (!loadProcesses.isEmpty()) { current = loadProcesses.remove(); - logger.debug(current.getMessage()); + logger.debug("{}", current.getMessage()); current.begin(); } } diff --git a/engine/src/main/java/org/terasology/engine/core/module/ModuleListDownloader.java b/engine/src/main/java/org/terasology/engine/core/module/ModuleListDownloader.java index 6cb1730c3b8..7921b2e4b5e 100644 --- a/engine/src/main/java/org/terasology/engine/core/module/ModuleListDownloader.java +++ b/engine/src/main/java/org/terasology/engine/core/module/ModuleListDownloader.java @@ -65,7 +65,7 @@ public ModuleRegistry call() throws IOException { } int count = modules.size(); - logger.info(String.format("Retrieved %d %s", count, (count == 1) ? "entry" : "entries")); + logger.info("Retrieved {} {}", count, (count == 1) ? "entry" : "entries"); } return modules; } diff --git a/engine/src/main/java/org/terasology/engine/entitySystem/event/internal/EventSystemImpl.java b/engine/src/main/java/org/terasology/engine/entitySystem/event/internal/EventSystemImpl.java index 22c1ab65a7a..5c95213c4d5 100644 --- a/engine/src/main/java/org/terasology/engine/entitySystem/event/internal/EventSystemImpl.java +++ b/engine/src/main/java/org/terasology/engine/entitySystem/event/internal/EventSystemImpl.java @@ -95,11 +95,11 @@ public void registerEvent(ResourceUrn uri, Class eventType) { public void registerEventHandler(ComponentSystem handler) { Class handlerClass = handler.getClass(); if (!Modifier.isPublic(handlerClass.getModifiers())) { - logger.error("Cannot register handler {}, must be public", handler.getClass().getName()); + logger.error("Cannot register handler {}, must be public", handlerClass.getName()); return; } - logger.debug("Registering event handler " + handlerClass.getName()); + logger.debug("Registering event handler {}", handlerClass.getName()); for (Method method : handlerClass.getMethods()) { ReceiveEvent receiveEventAnnotation = method.getAnnotation(ReceiveEvent.class); if (receiveEventAnnotation != null) { @@ -127,7 +127,7 @@ public void registerEventHandler(ComponentSystem handler) { method.setAccessible(true); Class[] types = method.getParameterTypes(); - logger.debug("Found method: " + method.toString()); + logger.debug("Found method: {}", method); if (!Event.class.isAssignableFrom(types[0]) || !EntityRef.class.isAssignableFrom(types[1])) { logger.error("Invalid event handler method: {}", method.getName()); return; diff --git a/engine/src/main/java/org/terasology/engine/i18n/TranslationSystemImpl.java b/engine/src/main/java/org/terasology/engine/i18n/TranslationSystemImpl.java index 690ec2f18d4..04d2f190325 100644 --- a/engine/src/main/java/org/terasology/engine/i18n/TranslationSystemImpl.java +++ b/engine/src/main/java/org/terasology/engine/i18n/TranslationSystemImpl.java @@ -58,7 +58,7 @@ public void refresh() { TranslationProject proj = projects.computeIfAbsent(projectUrn, e -> new StandardTranslationProject()); proj.add(trans); trans.subscribe(this::onAssetChanged); - logger.info("Discovered " + trans); + logger.info("Discovered {}", trans); } else { logger.warn("Ignoring invalid project projectUrn: {}", projectUrn); } diff --git a/engine/src/main/java/org/terasology/engine/logic/behavior/core/ActionNode.java b/engine/src/main/java/org/terasology/engine/logic/behavior/core/ActionNode.java index 90413b23cd5..7fb687008a1 100644 --- a/engine/src/main/java/org/terasology/engine/logic/behavior/core/ActionNode.java +++ b/engine/src/main/java/org/terasology/engine/logic/behavior/core/ActionNode.java @@ -56,7 +56,7 @@ public void construct(Actor actor) { try { action.construct(actor); } catch (Exception e) { - logger.debug("Exception while running construct() of action {} from entity {}: {}", action, actor.getEntity(), e.getMessage()); + logger.debug("Exception while running construct() of action {} from entity {}: ", action, actor.getEntity(), e); } } } diff --git a/engine/src/main/java/org/terasology/engine/logic/characters/CharacterSystem.java b/engine/src/main/java/org/terasology/engine/logic/characters/CharacterSystem.java index 34ede66c8ce..ec3dd3ca18d 100644 --- a/engine/src/main/java/org/terasology/engine/logic/characters/CharacterSystem.java +++ b/engine/src/main/java/org/terasology/engine/logic/characters/CharacterSystem.java @@ -154,8 +154,8 @@ public String getDamageTypeName(Prefab damageType) { if (damageType.hasComponent(DisplayNameComponent.class)) { return damageType.getComponent(DisplayNameComponent.class).name; } else { - logger.info(String.format("%s is missing a readable DisplayName", damageType.getName())); String damageTypeName = damageType.getName(); + logger.info("{} is missing a readable DisplayName", damageTypeName); //damageType.getName() returns a ResourceUrn String such as "engine:directDamage" //The following calls change the damage type to be more readable //For instance, "engine:directDamage" becomes "Direct Damage" @@ -315,35 +315,35 @@ private boolean isPredictionOfEventCorrect(EntityRef character, ActivationReques Vector3f originPos = location.getWorldPosition(new Vector3f()); if (!(event.getOrigin().equals(originPos, 0.0001f))) { - String msg = "Player {} seems to have cheated: It stated that it performed an action from {} but the predicted position is {}"; - logger.info(msg, getPlayerNameFromCharacter(character), event.getOrigin(), originPos); + logger.info("Player {} seems to have cheated: It stated that it performed an action from {} but the predicted position is {}", + getPlayerNameFromCharacter(character), event.getOrigin(), originPos); return false; } if (event.isOwnedEntityUsage()) { if (!event.getUsedOwnedEntity().exists()) { - String msg = "Denied activation attempt by {} since the used entity does not exist on the authority"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since the used entity does not exist on the authority", + getPlayerNameFromCharacter(character)); return false; } if (!networkSystem.getOwnerEntity(event.getUsedOwnedEntity()).equals(networkSystem.getOwnerEntity(character))) { - String msg = "Denied activation attempt by {} since it does not own the entity at the authority"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since it does not own the entity at the authority", + getPlayerNameFromCharacter(character)); return false; } } else { // check for cheats so that data can later be trusted: if (event.getUsedOwnedEntity().exists()) { - String msg = "Denied activation attempt by {} since it is not properly marked as owned entity usage"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since it is not properly marked as owned entity usage", + getPlayerNameFromCharacter(character)); return false; } } if (event.isEventWithTarget()) { if (!event.getTarget().exists()) { - String msg = "Denied activation attempt by {} since the target does not exist on the authority"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since the target does not exist on the authority", + getPlayerNameFromCharacter(character)); return false; // can happen if target existed on client } @@ -360,8 +360,8 @@ private boolean isPredictionOfEventCorrect(EntityRef character, ActivationReques HitResult result = physics.rayTrace(originPos, direction, interactionRange, Sets.newHashSet(character), DEFAULTPHYSICSFILTER); if (!result.isHit()) { - String msg = "Denied activation attempt by {} since at the authority there was nothing to activate at that place"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since at the authority there was nothing to activate at that place", + getPlayerNameFromCharacter(character)); return false; } EntityRef hitEntity = result.getEntity(); @@ -371,31 +371,31 @@ private boolean isPredictionOfEventCorrect(EntityRef character, ActivationReques * server entity dump. When certain fields don't get replicated, then wrong entity might get hin in the * hit test. */ - String msg = "Denied activation attempt by {} since at the authority another entity would have been activated"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since at the authority another entity would have been activated", + getPlayerNameFromCharacter(character)); return false; } if (!(event.getHitPosition().equals(result.getHitPoint(), 0.0001f))) { - String msg = "Denied activation attempt by {} since at the authority the object got hit at a differnt position"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since at the authority the object got hit at a differnt position", + getPlayerNameFromCharacter(character)); return false; } } else { // In order to trust the data later we need to verify it even if it should be correct if no one cheats: if (event.getTarget().exists()) { - String msg = "Denied activation attempt by {} since the event was not properly labeled as having a target"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since the event was not properly labeled as having a target", + getPlayerNameFromCharacter(character)); return false; } if (event.getHitPosition() != null) { - String msg = "Denied activation attempt by {} since the event was not properly labeled as having a hit position"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since the event was not properly labeled as having a hit position", + getPlayerNameFromCharacter(character)); return false; } if (event.getHitNormal() != null) { - String msg = "Denied activation attempt by {} since the event was not properly labeled as having a hit delta"; - logger.info(msg, getPlayerNameFromCharacter(character)); + logger.info("Denied activation attempt by {} since the event was not properly labeled as having a hit delta", + getPlayerNameFromCharacter(character)); return false; } } diff --git a/engine/src/main/java/org/terasology/engine/logic/config/ModuleConfigSystem.java b/engine/src/main/java/org/terasology/engine/logic/config/ModuleConfigSystem.java index fb5026e9ded..9158ed46990 100644 --- a/engine/src/main/java/org/terasology/engine/logic/config/ModuleConfigSystem.java +++ b/engine/src/main/java/org/terasology/engine/logic/config/ModuleConfigSystem.java @@ -32,8 +32,8 @@ public void preBegin() { String moduleName = moduleConfig.moduleName; Map properties; if (propertiesPerModule.containsKey(moduleName)) { - logger.error("Encountered more than one Module Config for module - " + moduleName + - ", this is not recommended, as the property values visible are not going to be well defined."); + logger.error("Encountered more than one Module Config for module - {}, this is not recommended, " + + "as the property values visible are not going to be well defined.", moduleName); properties = propertiesPerModule.get(moduleName); } else { properties = new HashMap<>(); diff --git a/engine/src/main/java/org/terasology/engine/logic/inventory/ItemPickupAuthoritySystem.java b/engine/src/main/java/org/terasology/engine/logic/inventory/ItemPickupAuthoritySystem.java index 832ee1b0d38..a50324e917e 100644 --- a/engine/src/main/java/org/terasology/engine/logic/inventory/ItemPickupAuthoritySystem.java +++ b/engine/src/main/java/org/terasology/engine/logic/inventory/ItemPickupAuthoritySystem.java @@ -82,7 +82,7 @@ public void updateExtentsOnBlockItemBoxShape(OnAddedComponent event, EntityRef i BlockFamily blockFamily = blockItemComponent.blockFamily; if (blockFamily == null) { - LOGGER.warn("Prefab " + itemEntity.getParentPrefab().getName() + " does not have a block family"); + LOGGER.warn("Prefab {} does not have a block family", itemEntity.getParentPrefab().getName()); return; } diff --git a/engine/src/main/java/org/terasology/engine/network/internal/ClientConnectionHandler.java b/engine/src/main/java/org/terasology/engine/network/internal/ClientConnectionHandler.java index 539f280a920..7f9f19cf3dc 100644 --- a/engine/src/main/java/org/terasology/engine/network/internal/ClientConnectionHandler.java +++ b/engine/src/main/java/org/terasology/engine/network/internal/ClientConnectionHandler.java @@ -160,8 +160,8 @@ private void receiveModuleStart(ChannelHandlerContext channelHandlerContext, joinStatus.setCurrentActivity( "Downloading " + moduleDataHeader.getId() + ":" + moduleDataHeader.getVersion() + " (" + sizeString + "," + missingModules.size() + " modules remain)"); - logger.info("Downloading " + moduleDataHeader.getId() + ":" + moduleDataHeader.getVersion() + " (" - + sizeString + "," + missingModules.size() + " modules remain)"); + logger.info("Downloading {}: {} ({}, {} modules remain)", moduleDataHeader.getId(), moduleDataHeader.getVersion(), + sizeString, missingModules.size()); receivingModule = moduleDataHeader; lengthReceived = 0; try { @@ -176,8 +176,7 @@ private void receiveModuleStart(ChannelHandlerContext channelHandlerContext, } } } else { - logger.error("Received unwanted module {}:{} from server", moduleDataHeader.getId(), - moduleDataHeader.getVersion()); + logger.error("Received unwanted module {}:{} from server", moduleDataHeader.getId(), moduleDataHeader.getVersion()); joinStatus.setErrorMessage("Module download error"); channelHandlerContext.channel().close(); } diff --git a/engine/src/main/java/org/terasology/engine/network/internal/NetworkSystemImpl.java b/engine/src/main/java/org/terasology/engine/network/internal/NetworkSystemImpl.java index cc856a6ccb9..4df2f9c669e 100644 --- a/engine/src/main/java/org/terasology/engine/network/internal/NetworkSystemImpl.java +++ b/engine/src/main/java/org/terasology/engine/network/internal/NetworkSystemImpl.java @@ -827,7 +827,7 @@ private void processRemovedClient(Client client) { } clientList.remove(client); clientPlayerLookup.remove(client.getEntity()); - logger.info("Client disconnected: " + client.getName()); + logger.info("Client disconnected: {}", client.getName()); storageManager.deactivatePlayer(client); client.getEntity().send(new DisconnectedEvent()); client.disconnect(); @@ -973,8 +973,7 @@ private Map, Integer> generateIds(ClassLibrary classLi int fieldId = 0; for (FieldMetadata field : metadata.getFields()) { if (fieldId >= 256) { - logger.error("Class {} has too many fields (>255), serialization will be incomplete", - metadata.getId()); + logger.error("Class {} has too many fields (>255), serialization will be incomplete", metadata.getId()); break; } field.setId((byte) fieldId); diff --git a/engine/src/main/java/org/terasology/engine/network/internal/ServerInfoRequestHandler.java b/engine/src/main/java/org/terasology/engine/network/internal/ServerInfoRequestHandler.java index d92a56ae7e9..ea9a8ab790b 100644 --- a/engine/src/main/java/org/terasology/engine/network/internal/ServerInfoRequestHandler.java +++ b/engine/src/main/java/org/terasology/engine/network/internal/ServerInfoRequestHandler.java @@ -20,7 +20,7 @@ public class ServerInfoRequestHandler extends ChannelInboundHandlerAdapter { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - logger.warn("Could not query server info: {}", cause.toString()); + logger.warn("Could not query server info: ", cause); } @Override diff --git a/engine/src/main/java/org/terasology/engine/persistence/internal/GlobalStoreLoader.java b/engine/src/main/java/org/terasology/engine/persistence/internal/GlobalStoreLoader.java index 7c6f2a86309..d6f5f73d9d8 100644 --- a/engine/src/main/java/org/terasology/engine/persistence/internal/GlobalStoreLoader.java +++ b/engine/src/main/java/org/terasology/engine/persistence/internal/GlobalStoreLoader.java @@ -64,15 +64,16 @@ private void loadMissingPrefabs(EntityData.GlobalStore globalStore) { Map pendingPrefabs = Maps.newHashMap(); for (EntityData.Prefab prefabData : globalStore.getPrefabList()) { if (!prefabManager.exists(prefabData.getName())) { + String prefabDataName = prefabData.getName(); if (!prefabData.hasParentName()) { - Module module = environment.get(new SimpleUri(prefabData.getName()).getModuleName()); + Module module = environment.get(new SimpleUri(prefabDataName).getModuleName()); try (ModuleContext.ContextSpan ignored = ModuleContext.setContext(module)) { createPrefab(prefabData); } catch (Exception e) { - logger.error("Failed to load prefab {}", prefabData.getName(), e); + logger.error("Failed to load prefab {}", prefabDataName, e); } } else { - pendingPrefabs.put(prefabData.getName(), prefabData); + pendingPrefabs.put(prefabDataName, prefabData); } } } diff --git a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionAssetTypeHandler.java b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionAssetTypeHandler.java index 44413eb6155..0033bebfd62 100644 --- a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionAssetTypeHandler.java +++ b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionAssetTypeHandler.java @@ -27,7 +27,7 @@ public TextureRegionAsset getFromString(String representation) { if (region.isPresent()) { return region.get(); } else { - logger.error("Failed to resolve texture region '" + representation + "'"); + logger.error("Failed to resolve texture region '{}'", representation); return Assets.getTextureRegion("engine:default").get(); } } diff --git a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionTypeHandler.java b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionTypeHandler.java index daaeaae40fb..0454279a961 100644 --- a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionTypeHandler.java +++ b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/TextureRegionTypeHandler.java @@ -29,7 +29,7 @@ public TextureRegion getFromString(String representation) { if (region.isPresent()) { return region.get(); } else { - logger.error("Failed to resolve texture region '" + representation + "'"); + logger.error("Failed to resolve texture region '{}'", representation); return Assets.getTextureRegion("engine:default").get(); } } diff --git a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/UITextureRegionTypeHandler.java b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/UITextureRegionTypeHandler.java index e96045e9da5..2327aa67c25 100644 --- a/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/UITextureRegionTypeHandler.java +++ b/engine/src/main/java/org/terasology/engine/persistence/typeHandling/extensionTypes/UITextureRegionTypeHandler.java @@ -30,7 +30,7 @@ public UITextureRegion getFromString(String representation) { if (region.isPresent()) { return region.get(); } else { - logger.error("Failed to resolve texture region '" + representation + "'"); + logger.error("Failed to resolve texture region '{}'", representation); return Assets.getTextureRegion("engine:default").get(); } } diff --git a/engine/src/main/java/org/terasology/engine/recording/EventCopier.java b/engine/src/main/java/org/terasology/engine/recording/EventCopier.java index 7c810d3ffde..349227048d2 100644 --- a/engine/src/main/java/org/terasology/engine/recording/EventCopier.java +++ b/engine/src/main/java/org/terasology/engine/recording/EventCopier.java @@ -114,7 +114,7 @@ private InputEvent createNewBindEvent(InputEvent originalEvent) { | InvocationTargetException | InstantiationException exception) { - logger.error("ERROR!!! Event not Identified: " + originalEvent.toString(), exception); + logger.error("ERROR!!! Event not Identified: {}", originalEvent, exception); } return null; } diff --git a/engine/src/main/java/org/terasology/engine/recording/EventSystemReplayImpl.java b/engine/src/main/java/org/terasology/engine/recording/EventSystemReplayImpl.java index ba3ce7607a3..986ea7c2430 100644 --- a/engine/src/main/java/org/terasology/engine/recording/EventSystemReplayImpl.java +++ b/engine/src/main/java/org/terasology/engine/recording/EventSystemReplayImpl.java @@ -303,11 +303,11 @@ private boolean shouldAddToLibrary(Class eventType) { public void registerEventHandler(ComponentSystem handler) { Class handlerClass = handler.getClass(); if (!Modifier.isPublic(handlerClass.getModifiers())) { - logger.error("Cannot register handler {}, must be public", handler.getClass().getName()); + logger.error("Cannot register handler {}, must be public", handlerClass.getName()); return; } - logger.debug("Registering event handler " + handlerClass.getName()); + logger.debug("Registering event handler {}", handlerClass.getName()); for (Method method : handlerClass.getMethods()) { ReceiveEvent receiveEventAnnotation = method.getAnnotation(ReceiveEvent.class); if (receiveEventAnnotation != null) { @@ -334,7 +334,7 @@ public void registerEventHandler(ComponentSystem handler) { method.setAccessible(true); Class[] types = method.getParameterTypes(); - logger.debug("Found method: " + method.toString()); + logger.debug("Found method: {}", method); if (!Event.class.isAssignableFrom(types[0]) || !EntityRef.class.isAssignableFrom(types[1])) { logger.error("Invalid event handler method: {}", method.getName()); return; diff --git a/engine/src/main/java/org/terasology/engine/rendering/assets/atlas/AtlasFormat.java b/engine/src/main/java/org/terasology/engine/rendering/assets/atlas/AtlasFormat.java index e9429c76947..830e37cccc0 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/assets/atlas/AtlasFormat.java +++ b/engine/src/main/java/org/terasology/engine/rendering/assets/atlas/AtlasFormat.java @@ -80,16 +80,17 @@ public AtlasData load(ResourceUrn urn, List inputs) throws IOExce } private void process(FreeformDefinition freeform, Texture texture, Vector2ic size, Map out) { - if (freeform.getName() == null || freeform.getName().isEmpty()) { + String freeformName = freeform.getName(); + if (freeformName == null || freeformName.isEmpty()) { logger.error("Bad subimage definition - missing mandatory property name"); return; } if (freeform.getMin() == null) { - logger.error("Bad subimage definition '{}' - missing mandatory property min", freeform.getName()); + logger.error("Bad subimage definition '{}' - missing mandatory property min", freeformName); return; } if (freeform.getSize() == null && freeform.getMax() == null) { - logger.error("Bad subimage definition '{}' - requires one of max or size", freeform.getName()); + logger.error("Bad subimage definition '{}' - requires one of max or size", freeformName); return; } Vector2f min = new Vector2f((float) freeform.getMin().x / size.x(), (float) freeform.getMin().y / size.y()); @@ -97,11 +98,11 @@ private void process(FreeformDefinition freeform, Texture texture, Vector2ic siz Vector2f itemSize = new Vector2f((float) freeform.getSize().x / size.x(), (float) freeform.getSize().y / size.y()); - out.put(new Name(freeform.getName()), new SubtextureData(texture, + out.put(new Name(freeformName), new SubtextureData(texture, shrinkRegion(new Rectanglef(min, min).setSize(itemSize)))); } else if (freeform.getMax() != null) { Vector2f max = new Vector2f((float) freeform.getMax().x / size.x(), (float) freeform.getMax().y / size.y()); - out.put(new Name(freeform.getName()), new SubtextureData(texture, shrinkRegion(new Rectanglef(min, max)))); + out.put(new Name(freeformName), new SubtextureData(texture, shrinkRegion(new Rectanglef(min, max)))); } } diff --git a/engine/src/main/java/org/terasology/engine/rendering/dag/AbstractNode.java b/engine/src/main/java/org/terasology/engine/rendering/dag/AbstractNode.java index 7b5663f5c09..1f84907ce68 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/dag/AbstractNode.java +++ b/engine/src/main/java/org/terasology/engine/rendering/dag/AbstractNode.java @@ -232,7 +232,7 @@ public boolean addOutputBufferPairConnection(int id, BufferPairConnection from) // set data for all connected connections if (!localBufferPairConnection.getConnectedConnections().isEmpty()) { - logger.info("Propagating data from {} to all connected connections of {}: ", from.toString(), localBufferPairConnection); + logger.info("Propagating data from {} to all connected connections of {}: ", from, localBufferPairConnection); localBufferPairConnection.getConnectedConnections().forEach((k, v) -> { logger.info("setting data for: {} ,", v); v.setData(from.getData()); @@ -472,7 +472,7 @@ public List getOutputConnectionsList() { } public void disconnectInputFbo(int inputId) { - logger.info("Disconnecting" + this.getUri() + " input Fbo number " + inputId); + logger.info("Disconnecting {} input Fbo number {}", this.getUri(), inputId); DependencyConnection connectionToDisconnect = this.inputConnections.get(FboConnection.getConnectionName(inputId, this.nodeUri)); if (connectionToDisconnect != null) { // TODO make it reconnectInputFboToOutput @@ -548,7 +548,7 @@ public void dispose() { protected void addDesiredStateChange(StateChange stateChange) { if (stateChange.isTheDefaultInstance()) { logger.error("Attempted to add default state change {} to the set of desired state changes. (Node: {})", - stateChange.getClass().getSimpleName(), this.toString()); + stateChange.getClass().getSimpleName(), this); } desiredStateChanges.add(stateChange); } diff --git a/engine/src/main/java/org/terasology/engine/rendering/dag/ModuleRendering.java b/engine/src/main/java/org/terasology/engine/rendering/dag/ModuleRendering.java index 2e0172e07fd..271f304ec8e 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/dag/ModuleRendering.java +++ b/engine/src/main/java/org/terasology/engine/rendering/dag/ModuleRendering.java @@ -118,9 +118,9 @@ protected FBO generateWithDimensions(FboConfig fboConfig, FBO.Dimensions dimensi // At this stage it's unclear what should be done in this circumstances as I (manu3d) do not know what // the effects of using an incomplete FrameBuffer are. Throw an exception? Live with visual artifacts? if (fbo.getStatus() == FBO.Status.INCOMPLETE) { - logger.error("FBO " + fboConfig.getName() + " is incomplete. Look earlier in the log for details."); + logger.error("FBO {} is incomplete. Look earlier in the log for details.", fboConfig.getName()); } else if (fbo.getStatus() == FBO.Status.UNEXPECTED) { - logger.error("FBO " + fboConfig.getName() + " has generated an unexpected status code. Look earlier in the log for details."); + logger.error("FBO {} has generated an unexpected status code. Look earlier in the log for details.", fboConfig.getName()); } return fbo; } diff --git a/engine/src/main/java/org/terasology/engine/rendering/dag/RenderGraph.java b/engine/src/main/java/org/terasology/engine/rendering/dag/RenderGraph.java index 8583fc992f1..7a0ac809d39 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/dag/RenderGraph.java +++ b/engine/src/main/java/org/terasology/engine/rendering/dag/RenderGraph.java @@ -169,7 +169,7 @@ public void disconnect(Node fromNode, Node toNode) { Preconditions.checkNotNull(toNode, "toNode cannot be null!"); if (!graph.hasEdgeConnecting(fromNode, toNode)) { - logger.warn("Trying to disconnect two nodes that aren't connected, {} and {}", fromNode.getUri(), toNode.getUri()); + logger.warn("Trying to disconnect two nodes that aren't connected, {} and {}", fromNode.getUri(), toNode.getUri()); } graph.removeEdge(fromNode, toNode); diff --git a/engine/src/main/java/org/terasology/engine/rendering/dag/RenderTaskListGenerator.java b/engine/src/main/java/org/terasology/engine/rendering/dag/RenderTaskListGenerator.java index 608ffb6a629..387d780f709 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/dag/RenderTaskListGenerator.java +++ b/engine/src/main/java/org/terasology/engine/rendering/dag/RenderTaskListGenerator.java @@ -48,15 +48,15 @@ private void logIntermediateRendererListForDebugging(List orderedNodes) { if (node.isEnabled()) { // printing out node name - logger.info(String.format(("----- %s"), node.getClass().getSimpleName())); + logger.info("----- {}", node.getClass().getSimpleName()); // printing out individual desired state changes for (StateChange desiredStateChange : node.getDesiredStateChanges()) { - logger.info(desiredStateChange.toString()); + logger.info("{}", desiredStateChange); } // printing out process() statement - logger.info(String.format("%s: process()", node.toString())); + logger.info("{}: process()", node); } } } @@ -172,9 +172,9 @@ public List generateFrom(List orderedNodes) { logger.debug("===== RENDERER TASK LIST ================================="); logList(taskList); logger.debug("----------------------------------------------------------"); - logger.debug(String.format("Task list generated in %.3f ms", (endTimeInNanoSeconds - startTimeInNanoSeconds) / 1000000f)); - logger.debug(String.format("%s nodes, %s enabled - %s tasks (excluding marker tasks) out of %s potential tasks.", - nodeList.size(), enabledNodes, taskList.size() - enabledNodes, potentialTasks)); + logger.debug("Task list generated in {} ms", String.format("%.3f", (endTimeInNanoSeconds - startTimeInNanoSeconds) / 1000000f)); + logger.debug("{} nodes, {} enabled - {} tasks (excluding marker tasks) out of {} potential tasks.", + nodeList.size(), enabledNodes, taskList.size() - enabledNodes, potentialTasks); logger.debug("----------------------------------------------------------"); // } @@ -183,7 +183,7 @@ public List generateFrom(List orderedNodes) { private void logList(List list) { for (Object object : list) { - logger.debug(object.toString()); + logger.debug("{}", object); } } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/asset/UIDeltaFormat.java b/engine/src/main/java/org/terasology/engine/rendering/nui/asset/UIDeltaFormat.java index 8c6b8ec5960..c02dc4bc04b 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/asset/UIDeltaFormat.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/asset/UIDeltaFormat.java @@ -47,7 +47,7 @@ public void apply(AssetDataFile input, UIData assetData) throws IOException { if (skin.isPresent()) { assetData.getRootWidget().setSkin(skin.get()); } else { - logger.warn("Failed to load skin " + skinUri + " for the delta file " + input.getFilename()); + logger.warn("Failed to load skin {} for the delta file {}", skinUri, input.getFilename()); } } } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUIEditorScreen.java b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUIEditorScreen.java index ea11760b404..6b93ce7c226 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUIEditorScreen.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUIEditorScreen.java @@ -279,7 +279,7 @@ public void selectAsset(ResourceUrn urn) { reader.setLenient(true); content = new JsonParser().parse(reader).toString(); } catch (IOException e) { - logger.error(String.format("Could not load asset source file for %s", urn.toString()), e); + logger.error("Could not load asset source file for {}", urn, e); } if (content != null) { diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUISkinEditorScreen.java b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUISkinEditorScreen.java index 633afffeeb3..6885e793d0f 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUISkinEditorScreen.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/layers/NUISkinEditorScreen.java @@ -315,7 +315,7 @@ public void selectAsset(ResourceUrn urn) { reader.setLenient(true); content = new JsonParser().parse(reader).toString(); } catch (IOException e) { - logger.error(String.format("Could not load asset source file for %s", urn.toString()), e); + logger.error("Could not load asset source file for {}", urn, e); } if (content != null) { diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/utils/NUIEditorMenuTreeBuilder.java b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/utils/NUIEditorMenuTreeBuilder.java index 268c2e64d9b..2ccbb245d56 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/editor/utils/NUIEditorMenuTreeBuilder.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/editor/utils/NUIEditorMenuTreeBuilder.java @@ -259,7 +259,7 @@ private void populateContextMenu(JsonTree node, MenuTree addTree, boolean isSkin } } } else { - logger.warn("Could not get class for node {}", node.getValue().toString()); + logger.warn("Could not get class for node {}", node.getValue()); } } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectionScreen.java b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectionScreen.java index e7b92627a07..5ecbcd6cef1 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectionScreen.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectionScreen.java @@ -137,7 +137,7 @@ protected void remove(final UIList gameList, Path world, String remove gameList.setSelection(null); gameList.select(0); } catch (Exception e) { - logger.error("Failed to delete " + removeString, e); + logger.error("Failed to delete {}", removeString, e); getManager().pushScreen(MessagePopup.ASSET_URI, MessagePopup.class) .setMessage("Error Deleting Game", e.getMessage()); } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/advancedGameSetupScreen/AdvancedGameSetupScreen.java b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/advancedGameSetupScreen/AdvancedGameSetupScreen.java index 5b9b1f505d3..8ce2c1b9e7e 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/advancedGameSetupScreen/AdvancedGameSetupScreen.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/advancedGameSetupScreen/AdvancedGameSetupScreen.java @@ -406,7 +406,7 @@ public String get() { filterModules(); }); } else { - logger.error("Unable to find checkbox named " + checkboxName + " in " + ASSET_URI.toString()); + logger.error("Unable to find checkbox named {} in {}", checkboxName, ASSET_URI); selectModulesConfig.unselectStandardModuleExtension(standardModuleExtension); } } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/savedGames/GameProvider.java b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/savedGames/GameProvider.java index fb4a6853cce..fffe845edd3 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/savedGames/GameProvider.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/savedGames/GameProvider.java @@ -88,8 +88,8 @@ private static List getSavedGameOrRecording(Path saveOrRecordingPath) result.add(new GameInfo(info, date, world.getValue())); } } catch (NullPointerException npe) { - logger.error("The save file was corrupted for: " + world.toString() + ". The manifest can be " + - "found and restored at: " + gameManifest.toString(), npe); + logger.error("The save file was corrupted for: {}. The manifest can be found and restored at: {}", + world, gameManifest, npe); } } catch (IOException e) { logger.error("Failed reading world data object.", e); diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/widgets/UIButtonWebBrowser.java b/engine/src/main/java/org/terasology/engine/rendering/nui/widgets/UIButtonWebBrowser.java index e63715a2972..108fb31036d 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/widgets/UIButtonWebBrowser.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/widgets/UIButtonWebBrowser.java @@ -125,7 +125,7 @@ private void showConfirmationPopup() { confirmUrlPopup.setCheckbox(webBrowserConfig, this.url); } } catch (MalformedURLException e) { - logger.error(this.url + " is malformed", e); + logger.error("{} is malformed", this.url, e); } } @@ -157,7 +157,7 @@ public UIButtonWebBrowser setUrl(String url) { String hostname = new URL(url).getHost(); trustedHostName = webBrowserConfig.isHostNameTrusted(hostname); } catch (MalformedURLException e) { - logger.error(url + " is malformed", e); + logger.error("{} is malformed", url, e); } if (!trustedHostName) { diff --git a/engine/src/main/java/org/terasology/engine/rendering/opengl/AbstractFboManager.java b/engine/src/main/java/org/terasology/engine/rendering/opengl/AbstractFboManager.java index 73846de3419..6e3a75c4ddc 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/opengl/AbstractFboManager.java +++ b/engine/src/main/java/org/terasology/engine/rendering/opengl/AbstractFboManager.java @@ -40,16 +40,17 @@ public abstract class AbstractFboManager extends AbstractSubscribable implements protected FBO generateWithDimensions(FboConfig fboConfig, FBO.Dimensions dimensions) { fboConfig.setDimensions(dimensions); FBO fbo = FBO.create(fboConfig); + SimpleUri fboConfigName = fboConfig.getName(); // At this stage it's unclear what should be done in this circumstances as I (manu3d) do not know what // the effects of using an incomplete FrameBuffer are. Throw an exception? Live with visual artifacts? if (fbo.getStatus() == FBO.Status.INCOMPLETE) { - logger.error("FBO {} is incomplete. Look earlier in the log for details.", fboConfig.getName()); + logger.error("FBO {} is incomplete. Look earlier in the log for details.", fboConfigName); } else if (fbo.getStatus() == FBO.Status.UNEXPECTED) { - logger.error("FBO {} has generated an unexpected status code. Look earlier in the log for details.", fboConfig.getName()); + logger.error("FBO {} has generated an unexpected status code. Look earlier in the log for details.", fboConfigName); } - fboLookup.put(fboConfig.getName(), fbo); - fboConfigs.put(fboConfig.getName(), fboConfig); + fboLookup.put(fboConfigName, fbo); + fboConfigs.put(fboConfigName, fboConfig); return fbo; } diff --git a/engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java b/engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java index c75a60454ae..3d65a79a6fc 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java +++ b/engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java @@ -376,7 +376,7 @@ protected void doReload(ShaderData data) { try { registerAllShaderPermutations(); } catch (RuntimeException e) { - logger.warn(e.getMessage()); + logger.warn("{}", e.getMessage()); } }); } catch (InterruptedException e) { diff --git a/engine/src/main/java/org/terasology/engine/rendering/world/WorldRendererImpl.java b/engine/src/main/java/org/terasology/engine/rendering/world/WorldRendererImpl.java index d2ccde78cf5..e8a1472d271 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/world/WorldRendererImpl.java +++ b/engine/src/main/java/org/terasology/engine/rendering/world/WorldRendererImpl.java @@ -205,9 +205,9 @@ private void initRenderingModules() { for (ModuleRendering moduleRenderingInstance : renderingModuleRegistry.getOrderedRenderingModules()) { if (moduleRenderingInstance.isEnabled()) { - logger.info(String.format("\nInitialising rendering class %s from %s module.\n", + logger.info("\nInitialising rendering class {} from {} module.\n", moduleRenderingInstance.getClass().getSimpleName(), - moduleRenderingInstance.getProvidingModule())); + moduleRenderingInstance.getProvidingModule()); moduleRenderingInstance.initialise(); } } diff --git a/engine/src/main/java/org/terasology/engine/world/chunks/pipeline/ChunkProcessingPipeline.java b/engine/src/main/java/org/terasology/engine/world/chunks/pipeline/ChunkProcessingPipeline.java index 15fce52938f..5ebe58bba29 100644 --- a/engine/src/main/java/org/terasology/engine/world/chunks/pipeline/ChunkProcessingPipeline.java +++ b/engine/src/main/java/org/terasology/engine/world/chunks/pipeline/ChunkProcessingPipeline.java @@ -115,10 +115,7 @@ private void onStageDone(PositionFuture future, ChunkProcessingInfo chunk chunkProcessingInfo.getChunkTaskProvider() == null ? "Generation or Loading" : chunkProcessingInfo.getChunkTaskProvider().getName(); - logger.error( - String.format("ChunkTask at position %s and stage [%s] catch error: ", - chunkProcessingInfo.getPosition(), stageName), - e); + logger.error("ChunkTask at position {} and stage [{}] catch error: {}", chunkProcessingInfo.getPosition(), stageName, e.getMessage()); chunkProcessingInfo.getExternalFuture().setException(e); } catch (CancellationException ignored) { } diff --git a/engine/src/main/resources/org/terasology/engine/logback/setup.xml b/engine/src/main/resources/org/terasology/engine/logback/setup.xml index d46adece4c0..43632e07626 100644 --- a/engine/src/main/resources/org/terasology/engine/logback/setup.xml +++ b/engine/src/main/resources/org/terasology/engine/logback/setup.xml @@ -14,6 +14,6 @@ - + diff --git a/facades/PC/build.gradle.kts b/facades/PC/build.gradle.kts index d1ab573ed71..946ed2d99ab 100644 --- a/facades/PC/build.gradle.kts +++ b/facades/PC/build.gradle.kts @@ -71,7 +71,7 @@ dependencies { // TODO: Consider whether we can move the CR dependency back here from the engine, where it is referenced from the main menu implementation(group = "org.terasology.crashreporter", name = "cr-terasology", version = "5.0.0") - runtimeOnly("ch.qos.logback:logback-classic:1.2.11") { + runtimeOnly("ch.qos.logback:logback-classic:1.2.12") { because("to configure logging with logback.xml") } runtimeOnly("org.codehaus.janino:janino:3.1.7") { diff --git a/subsystems/DiscordRPC/src/main/java/org/terasology/subsystem/discordrpc/DiscordRPCThread.java b/subsystems/DiscordRPC/src/main/java/org/terasology/subsystem/discordrpc/DiscordRPCThread.java index 0fe4b23f2fd..68d1de94650 100644 --- a/subsystems/DiscordRPC/src/main/java/org/terasology/subsystem/discordrpc/DiscordRPCThread.java +++ b/subsystems/DiscordRPC/src/main/java/org/terasology/subsystem/discordrpc/DiscordRPCThread.java @@ -189,7 +189,7 @@ public void run() { // Retry to connect again } } catch (RuntimeException e) { - logger.error("Could not create or connect Discord client: {}", e.getMessage()); + logger.error("Could not create or connect Discord client: ", e); return; } } @@ -204,7 +204,7 @@ public void run() { /* Update the rich presence and keeping the connection alive */ while (connected) { synchronized (this) { - /* Ping the ipc connection with an rich presnece to keep the connection alive */ + /* Ping the ipc connection with a rich presence to keep the connection alive */ if (enabled) { /* Allocate a new rich presence when the buffer has changed */ if (buffer.hasChanged() && buffer.isEmpty()) { diff --git a/subsystems/TypeHandlerLibrary/src/main/java/org/terasology/persistence/typeHandling/coreTypes/GenericMapTypeHandler.java b/subsystems/TypeHandlerLibrary/src/main/java/org/terasology/persistence/typeHandling/coreTypes/GenericMapTypeHandler.java index ebec6d4dd64..993b816f196 100644 --- a/subsystems/TypeHandlerLibrary/src/main/java/org/terasology/persistence/typeHandling/coreTypes/GenericMapTypeHandler.java +++ b/subsystems/TypeHandlerLibrary/src/main/java/org/terasology/persistence/typeHandling/coreTypes/GenericMapTypeHandler.java @@ -70,7 +70,7 @@ public Optional> deserialize(PersistedData data) { } if (!data.isArray() || data.isValueMap()) { - logger.warn("Incorrect map format detected: object instead of array.\n" + getUsageInfo(data)); + logger.warn("Incorrect map format detected: object instead of array.\n{}", getUsageInfo(data)); return Optional.empty(); } @@ -79,7 +79,7 @@ public Optional> deserialize(PersistedData data) { PersistedData rawKey = kvEntry.get(KEY); PersistedData rawValue = kvEntry.get(VALUE); if (rawKey == null || rawValue == null) { - logger.warn("Incorrect map format detected: missing map entry with \"key\" or \"value\" key.\n" + getUsageInfo(data)); + logger.warn("Incorrect map format detected: missing map entry with \"key\" or \"value\" key.\n{}", getUsageInfo(data)); return Optional.empty(); }