Merge branch 'feat/60-shorten-logger-name' into 'main'
Short logger names to reduce visual clutter in log output Closes #60 See merge request cs108-fs26/Gruppe-13!166
This commit was merged in pull request #322.
This commit is contained in:
@@ -52,7 +52,7 @@ public final class Main {
|
||||
}
|
||||
|
||||
private static void printUsage() {
|
||||
Logger logger = LogManager.getLogger(Main.class);
|
||||
Logger logger = LogManager.getLogger(Main.class.getSimpleName());
|
||||
logger.fatal(
|
||||
"""
|
||||
Usage:
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
public class ClientApp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(ClientApp.class);
|
||||
private static final Logger LOGGER = LogManager.getLogger(ClientApp.class.getSimpleName());
|
||||
|
||||
/** Shared client connection used when a username is provided at startup. */
|
||||
private static volatile ClientService sharedClientService;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ChatController {
|
||||
chatModelMap = new LinkedHashMap<>();
|
||||
localUserList = new ArrayList<>();
|
||||
this.chatBoxController = new ChatBoxController(username, this);
|
||||
this.logger = LogManager.getLogger(ChatController.class);
|
||||
this.logger = LogManager.getLogger(ChatController.class.getSimpleName());
|
||||
this.serverEventListener = this::handleServerEvent;
|
||||
this.activeChatControllers = new HashMap<>();
|
||||
|
||||
@@ -124,7 +124,7 @@ public class ChatController {
|
||||
chatModelMap = new LinkedHashMap<>();
|
||||
localUserList = new ArrayList<>();
|
||||
this.chatBoxController = new ChatBoxController(username, this);
|
||||
this.logger = LogManager.getLogger(ChatController.class);
|
||||
this.logger = LogManager.getLogger(ChatController.class.getSimpleName());
|
||||
this.serverEventListener = this::handleServerEvent;
|
||||
this.activeChatControllers = new HashMap<>();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ChatClient implements ChatClientInterface {
|
||||
*/
|
||||
public ChatClient(ClientService clientService) {
|
||||
this.clientService = clientService;
|
||||
this.logger = LogManager.getLogger(ChatClient.class);
|
||||
this.logger = LogManager.getLogger(ChatClient.class.getSimpleName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ClientService {
|
||||
public ClientService(String ip, int port) {
|
||||
this.idGenerator = new AtomicInteger(0);
|
||||
|
||||
this.logger = LogManager.getLogger(ClientService.class);
|
||||
this.logger = LogManager.getLogger(ClientService.class.getSimpleName());
|
||||
|
||||
this.offlineMode = false;
|
||||
|
||||
|
||||
+2
-1
@@ -68,7 +68,8 @@ public class CasinoBrowserController {
|
||||
private static final CookieManager COOKIE_MANAGER =
|
||||
new CookieManager(null, CookiePolicy.ACCEPT_ORIGINAL_SERVER);
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(CasinoBrowserController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(CasinoBrowserController.class.getSimpleName());
|
||||
|
||||
private static final ObservableList<String> URL_SUGGESTIONS =
|
||||
FXCollections.observableArrayList(TRUSTED_DOMAINS);
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ import org.apache.logging.log4j.Logger;
|
||||
/** Controller for the highscore popup window. */
|
||||
public class HighscoreViewController {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(HighscoreViewController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(HighscoreViewController.class.getSimpleName());
|
||||
|
||||
@FXML private ListView<String> highscoreList;
|
||||
@FXML private Label statusLabel;
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
public class NotebookController {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(NotebookController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(NotebookController.class.getSimpleName());
|
||||
|
||||
@FXML private VBox notebook;
|
||||
@FXML private ScrollPane tipsContent;
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
public class SettingsController {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(SettingsController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(SettingsController.class.getSimpleName());
|
||||
|
||||
@FXML private VBox settingsBox;
|
||||
@FXML private RadioButton themeStandard;
|
||||
|
||||
+2
-1
@@ -39,7 +39,8 @@ import org.apache.logging.log4j.Logger;
|
||||
*/
|
||||
public class TaskbarController {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(TaskbarController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(TaskbarController.class.getSimpleName());
|
||||
|
||||
@FXML private HBox taskbar;
|
||||
@FXML private TextField taskbarInput;
|
||||
|
||||
+2
-1
@@ -30,7 +30,8 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
/** Controller for the Casono main UI lobby. Handles UI initialization and user actions. */
|
||||
public class CasinomainuiController {
|
||||
private static final Logger LOGGER = LogManager.getLogger(CasinomainuiController.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(CasinomainuiController.class.getSimpleName());
|
||||
|
||||
@FXML private AnchorPane rootPane;
|
||||
@FXML private Label titleLabel;
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ public class LobbyButtonGridManager {
|
||||
private static final int MAX_BUTTONS = 8;
|
||||
private static final int GUEST_ID_LENGTH = 8;
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(LobbyButtonGridManager.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(LobbyButtonGridManager.class.getSimpleName());
|
||||
|
||||
private static final String BUTTON_FALLBACK_IMAGE = "/images/lobbypictures/error.png";
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ServerApp {
|
||||
public static void start(String arg) {
|
||||
int port = Integer.parseInt(arg);
|
||||
|
||||
Logger logger = LogManager.getLogger(ServerApp.class);
|
||||
Logger logger = LogManager.getLogger(ServerApp.class.getSimpleName());
|
||||
logger.info("Starting server at port {}", port);
|
||||
|
||||
EventBus eventBus = new EventBus();
|
||||
|
||||
+2
-1
@@ -23,7 +23,8 @@ import org.apache.logging.log4j.Logger;
|
||||
public class JoinLobbyHandler extends CommandHandler<JoinLobbyRequest> {
|
||||
private final LobbyManager lobbyManager;
|
||||
private final UserRegistry userRegistry;
|
||||
private static final Logger LOGGER = LogManager.getLogger(JoinLobbyHandler.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(JoinLobbyHandler.class.getSimpleName());
|
||||
|
||||
/**
|
||||
* Create a new {@link JoinLobbyHandler}.
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@ import org.apache.logging.log4j.Logger;
|
||||
/** Periodically removes expired empty lobbies and notifies connected sessions. */
|
||||
public class LobbyCleanupJob implements Runnable {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(LobbyCleanupJob.class);
|
||||
private static final Logger LOGGER =
|
||||
LogManager.getLogger(LobbyCleanupJob.class.getSimpleName());
|
||||
|
||||
private final LobbyManager lobbyManager;
|
||||
private final SessionManager sessionManager;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ public class UserCleanupJob implements Runnable {
|
||||
private final Duration reconnectThreshold;
|
||||
|
||||
public UserCleanupJob(UserRegistry registry, Duration reconnectThreshold) {
|
||||
this.logger = LogManager.getLogger(UserCleanupJob.class);
|
||||
this.logger = LogManager.getLogger(UserCleanupJob.class.getSimpleName());
|
||||
this.registry = registry;
|
||||
this.reconnectThreshold = reconnectThreshold;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apache.logging.log4j.Logger;
|
||||
public class UserFactory {
|
||||
private final UserRegistry registry;
|
||||
private final AtomicInteger anonymousCounter = new AtomicInteger(1);
|
||||
private static final Logger LOGGER = LogManager.getLogger(UserFactory.class);
|
||||
private static final Logger LOGGER = LogManager.getLogger(UserFactory.class.getSimpleName());
|
||||
|
||||
/**
|
||||
* Creates a new UserFactory backed by the given registry.
|
||||
|
||||
@@ -26,7 +26,7 @@ public class NetworkManager implements Runnable {
|
||||
*/
|
||||
public NetworkManager(Integer port, SessionManager sessionManager, CommandRouter router) {
|
||||
this.port = port;
|
||||
this.logger = LogManager.getLogger(NetworkManager.class);
|
||||
this.logger = LogManager.getLogger(NetworkManager.class.getSimpleName());
|
||||
this.thread = new Thread(this, "networkManager");
|
||||
this.running = true;
|
||||
this.sessionManager = sessionManager;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ public class SessionDisconnectJob implements Runnable {
|
||||
|
||||
public SessionDisconnectJob(
|
||||
SessionManager sessionManager, EventBus eventBus, Duration timeoutThreshold) {
|
||||
this.logger = LogManager.getLogger(SessionDisconnectJob.class);
|
||||
this.logger = LogManager.getLogger(SessionDisconnectJob.class.getSimpleName());
|
||||
this.sessionManager = sessionManager;
|
||||
this.eventBus = eventBus;
|
||||
this.timeoutThreshold = timeoutThreshold;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ public class SessionManager {
|
||||
public SessionManager(EventBus eventBus, CommandParserDispatcher dispatcher) {
|
||||
this.sessions = new ConcurrentHashMap<>();
|
||||
this.eventBus = eventBus;
|
||||
this.logger = LogManager.getLogger(SessionManager.class);
|
||||
this.logger = LogManager.getLogger(SessionManager.class.getSimpleName());
|
||||
this.dispatcher = dispatcher;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class SessionReader implements Runnable {
|
||||
this.router = session.getRouter();
|
||||
this.logger =
|
||||
LogManager.getLogger(
|
||||
SessionReader.class.toString() + "-" + session.getId().value());
|
||||
SessionReader.class.getSimpleName() + "-" + session.getId().value());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ public class SessionWriter implements Runnable {
|
||||
this.queue = session.getResponseQueue();
|
||||
this.logger =
|
||||
LogManager.getLogger(
|
||||
SessionReader.class.toString() + "-" + session.getId().value());
|
||||
SessionReader.class.getSimpleName() + "-" + session.getId().value());
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
||||
Reference in New Issue
Block a user