diff --git a/engine/src/main/java/org/terasology/engine/core/PathManager.java b/engine/src/main/java/org/terasology/engine/core/PathManager.java index ef2c8ebc679..a4c72363863 100644 --- a/engine/src/main/java/org/terasology/engine/core/PathManager.java +++ b/engine/src/main/java/org/terasology/engine/core/PathManager.java @@ -6,6 +6,8 @@ import com.google.common.collect.ImmutableList; import com.sun.jna.platform.win32.KnownFolders; import com.sun.jna.platform.win32.Shell32Util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.terasology.engine.context.Context; import org.terasology.engine.core.subsystem.DisplayDevice; import org.terasology.engine.utilities.OS; @@ -30,6 +32,7 @@ * Manager class that keeps track of the game's various paths and save directories. */ public final class PathManager { + private static final Logger LOGGER = LoggerFactory.getLogger(PathManager.class); private static final String TERASOLOGY_FOLDER_NAME = "Terasology"; private static final Path LINUX_HOME_SUBPATH = Paths.get(".local", "share", "terasology"); @@ -76,10 +79,9 @@ private static Path findInstallPath() { Path codeLocation = Paths.get(urlToSource); installationSearchPaths.add(codeLocation); // Not using logger because it's usually initialized after PathManager. - System.out.println("PathManager: Initial code location is " + codeLocation.toAbsolutePath()); + LOGGER.info("PathManager: Initial code location is " + codeLocation.toAbsolutePath()); } catch (URISyntaxException e) { - System.err.println("PathManager: Failed to convert code location to path."); - e.printStackTrace(); + LOGGER.error("PathManager: Failed to convert code location to path.", e); } // But that's not always true. This jar may be loaded from somewhere else on the classpath. @@ -89,7 +91,7 @@ private static Path findInstallPath() { // Use the current directory as a fallback. Path currentDirectory = Paths.get("").toAbsolutePath(); installationSearchPaths.add(currentDirectory); - System.out.println("PathManager: Working directory is " + currentDirectory); + LOGGER.info("PathManager: Working directory is " + currentDirectory); for (Path startPath : installationSearchPaths) { Path installationPath = findNativesHome(startPath, 5); diff --git a/engine/src/main/java/org/terasology/engine/logic/players/PlayerSystem.java b/engine/src/main/java/org/terasology/engine/logic/players/PlayerSystem.java index d7ec534e526..c8f958c9340 100644 --- a/engine/src/main/java/org/terasology/engine/logic/players/PlayerSystem.java +++ b/engine/src/main/java/org/terasology/engine/logic/players/PlayerSystem.java @@ -46,8 +46,7 @@ @RegisterSystem(RegisterMode.AUTHORITY) public class PlayerSystem extends BaseComponentSystem implements UpdateSubscriberSystem { - - private static final Logger logger = LoggerFactory.getLogger(PlayerSystem.class); + private static final Logger LOGGER = LoggerFactory.getLogger(PlayerSystem.class); @In private EntityManager entityManager; @In @@ -156,7 +155,7 @@ public void onConnect(ConnectedEvent connected, EntityRef entity) { private void restoreCharacter(EntityRef entity, EntityRef character) { Client clientListener = networkSystem.getOwner(entity); - System.out.println(clientListener); + LOGGER.info(clientListener.toString()); updateRelevanceEntity(entity, clientListener.getViewDistance().getChunkDistance()); ClientComponent client = entity.getComponent(ClientComponent.class); @@ -247,7 +246,7 @@ private void respawnPlayer(EntityRef clientEntity) { playerCharacter.addComponent(new AliveCharacterComponent()); playerCharacter.send(new CharacterTeleportEvent(spawnPosition)); - logger.debug("Re-spawing player at: {}", spawnPosition); + LOGGER.debug("Re-spawing player at: {}", spawnPosition); Client clientListener = networkSystem.getOwner(clientEntity); Vector3ic distance = clientListener.getViewDistance().getChunkDistance();