mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-23 00:39:16 +00:00
remove include time in startup logs
This commit is contained in:
@@ -1,68 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
||||||
Date: Sun, 2 Apr 2023 05:31:02 +0300
|
|
||||||
Subject: [PATCH] Include time in startup logs
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
index 525c1458043392359c0cc720eebf7638c459119e..be32ed0d57edc5f708ee39f796637f53935f2874 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
|
||||||
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
+import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Calendar;
|
|
||||||
@@ -24,6 +25,26 @@ public class Main {
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
|
|
||||||
+ // DivineMC start - include time in startup logs
|
|
||||||
+ private static final DateFormat startupDateFormat = new SimpleDateFormat("hh:mm:ss");
|
|
||||||
+
|
|
||||||
+ private static void printlnStartupToSystemOut(String type, String line) {
|
|
||||||
+ System.out.println("[" + startupDateFormat.format(new Date()) + " " + type + "]: " + line);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void printlnStartupInfoToSystemOut(String line) {
|
|
||||||
+ printlnStartupToSystemOut("INFO", line);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void printlnStartupWarningToSystemOut(String line) {
|
|
||||||
+ printlnStartupToSystemOut("WARN", line);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ public static void printlnStartupErrorToSystemOut(String line) {
|
|
||||||
+ printlnStartupToSystemOut("ERROR", line);
|
|
||||||
+ }
|
|
||||||
+ // DivineMC end
|
|
||||||
+
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// Paper start
|
|
||||||
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
|
|
||||||
@@ -317,17 +338,16 @@ public class Main {
|
|
||||||
// Paper start - Log Java and OS versioning to help with debugging plugin issues
|
|
||||||
java.lang.management.RuntimeMXBean runtimeMX = java.lang.management.ManagementFactory.getRuntimeMXBean();
|
|
||||||
java.lang.management.OperatingSystemMXBean osMX = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
|
|
||||||
+ String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")"; // DivineMC - include time in startup logs
|
|
||||||
+ String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")"; // DivineMC - include time in startup logs
|
|
||||||
if (runtimeMX != null && osMX != null) {
|
|
||||||
- String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
|
|
||||||
- String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
|
|
||||||
-
|
|
||||||
- System.out.println("System Info: " + javaInfo + " " + osInfo);
|
|
||||||
+ printlnStartupInfoToSystemOut("System Info: " + javaInfo + " " + osInfo); // DivineMC - include time in startup logs
|
|
||||||
} else {
|
|
||||||
- System.out.println("Unable to read system info");
|
|
||||||
+ printlnStartupInfoToSystemOut("System Info: " + javaInfo + " " + osInfo); // DivineMC - include time in startup logs
|
|
||||||
}
|
|
||||||
// Paper end
|
|
||||||
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
|
|
||||||
- System.out.println("Loading libraries, please wait...");
|
|
||||||
+ printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // DivineMC - include time in startup logs
|
|
||||||
net.minecraft.server.Main.main(options);
|
|
||||||
} catch (Throwable t) {
|
|
||||||
t.printStackTrace();
|
|
||||||
Reference in New Issue
Block a user