Skip to content

Commit

Permalink
logger instead of println, engine qa.
Browse files Browse the repository at this point in the history
  • Loading branch information
soloturn committed Jan 4, 2024
1 parent fb308fa commit 79665c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 6 additions & 4 deletions engine/src/main/java/org/terasology/engine/core/PathManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");

Expand Down Expand Up @@ -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.
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 79665c5

Please sign in to comment.