geforkt von Mirrors/Velocity
Merge pull request #36 from MatrixTunnel/feature/start-time
Add startup time to log messages
Dieser Commit ist enthalten in:
Commit
ebdf5854dd
@ -4,9 +4,15 @@ import com.velocitypowered.proxy.console.VelocityConsole;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Velocity {
|
||||
private static final Logger logger = LogManager.getLogger(Velocity.class);
|
||||
|
||||
private static long startTime;
|
||||
|
||||
static {
|
||||
// We use BufferedImage for favicons, and on macOS this puts the Java application in the dock. How inconvenient.
|
||||
// Force AWT to work with its head chopped off.
|
||||
@ -14,12 +20,15 @@ public class Velocity {
|
||||
}
|
||||
|
||||
public static void main(String... args) {
|
||||
startTime = System.currentTimeMillis();
|
||||
logger.info("Booting up Velocity...");
|
||||
|
||||
final VelocityServer server = VelocityServer.getServer();
|
||||
server.start();
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(server::shutdown, "Shutdown thread"));
|
||||
|
||||
logger.info("Done ({}s)!", new SimpleDateFormat("ss.S", Locale.getDefault()).format(new Date(System.currentTimeMillis() - startTime)));
|
||||
new VelocityConsole(server).start();
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren