Skip to content

Commit

Permalink
Add logs in main method
Browse files Browse the repository at this point in the history
  • Loading branch information
JonMike8 committed Nov 23, 2024
1 parent a08620f commit d98c0ae
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions MavenBack/src/main/java/ppp/ServerMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public static void main(String[] args) throws Exception {
Server server = new Server(8080);
WebAppContext webAppContext = new WebAppContext();
server.setHandler(webAppContext);
logger.info("Creating server...");
logger.error("AAAAAAAAAAAHHHHHHHHHHH");
logger.info("Web server created.");

// Load static content from the resources directory.
URL webAppDir =
Expand All @@ -54,31 +53,26 @@ public static void main(String[] args) throws Exception {
new ConfigurationBuilder(ServerConfig.class, new File("application.cfg")).build(true);

// Connect to the DB
System.out.print("DB connecting...\n\t");
logger.info("DB connecting...");
WebDb.init();
System.out.println("DB connected.");
logger.info("DB connected.");

// Initialize out DB caches
System.out.print("Initializing caches... ");
logger.info("Initializing caches...");
CUser.init();
CGames.init();
CGlicko.init();
GlickoTwo.init();
System.out.println("done.");
logger.info("Caches initialized.");

// Initialize the services
System.out.print("Initializing services... ");
logger.info("Initializing services...");
Thread serviceHandler = new ServiceHandlerThread();
serviceHandler.start();
System.out.println("done.");
logger.info("Services initialized.");

// Start the server! 🚀
server.start();
System.out.println("Server started!");
logger.info("Server started!");

// Keep the main thread alive while the server is running.
Expand Down

0 comments on commit d98c0ae

Please sign in to comment.