diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e304c0b..2b364c5 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,14 +5,22 @@
+
-
+
+
+
+
@@ -83,7 +91,7 @@
1758117514311
-
+
diff --git a/src/main/java/org/toop/Logging.java b/src/main/java/org/toop/Logging.java
new file mode 100644
index 0000000..9854799
--- /dev/null
+++ b/src/main/java/org/toop/Logging.java
@@ -0,0 +1,26 @@
+package org.toop;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.toop.eventbus.EventRegistry;
+
+public final class Logging {
+ public static void disableLogs() {
+ LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ Configuration config = ctx.getConfiguration();
+ LoggerConfig loggerConfig = config.getLoggerConfig(EventRegistry.class.getName());
+ loggerConfig.setLevel(Level.OFF);
+ ctx.updateLoggers(); // apply changes immediately
+ }
+
+ public static void enableLogs(Level level) {
+ LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
+ Configuration config = ctx.getConfiguration();
+ LoggerConfig loggerConfig = config.getLoggerConfig(EventRegistry.class.getName());
+ loggerConfig.setLevel(level);
+ ctx.updateLoggers();
+ }
+}
diff --git a/src/main/java/org/toop/Main.java b/src/main/java/org/toop/Main.java
index 8f0a871..c7801d6 100644
--- a/src/main/java/org/toop/Main.java
+++ b/src/main/java/org/toop/Main.java
@@ -1,24 +1,12 @@
package org.toop;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.toop.eventbus.EventRegistry;
-import org.toop.eventbus.Events;
-import org.toop.eventbus.GlobalEventBus;
+import org.toop.Logging;
import org.toop.server.backend.ServerManager;
import org.toop.server.frontend.ConnectionManager;
-import org.toop.server.backend.TcpServer;
-
-import org.toop.game.*;
-import org.toop.game.tictactoe.*;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
-import java.io.IOException;
-import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
public class Main {
@@ -26,7 +14,7 @@ public class Main {
public static void main(String[] args) throws ExecutionException, InterruptedException {
initSystems();
- disableLogs();
+ Logging.disableLogs();
ConsoleGui console = new ConsoleGui();
@@ -42,20 +30,4 @@ public class Main {
new ConnectionManager();
}
- public static void disableLogs() {
- LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
- Configuration config = ctx.getConfiguration();
- LoggerConfig loggerConfig = config.getLoggerConfig(EventRegistry.class.getName());
- loggerConfig.setLevel(Level.OFF);
- ctx.updateLoggers(); // apply changes immediately
- }
-
- public static void enableLogs(Level level) {
- LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
- Configuration config = ctx.getConfiguration();
- LoggerConfig loggerConfig = config.getLoggerConfig(EventRegistry.class.getName());
- loggerConfig.setLevel(level);
- ctx.updateLoggers();
- }
-
}