3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Made logging a bit more useful

Dieser Commit ist enthalten in:
Tim203 2019-09-15 09:57:02 +02:00
Ursprung 21ddc83da8
Commit 0690b30c02
3 geänderte Dateien mit 23 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -34,6 +34,11 @@ public interface Logger {
*/ */
void severe(String message); void severe(String message);
/**
* Logs a severe message and an exception to console
*/
void severe(String message, Throwable error);
/** /**
* Logs an error message to console * Logs an error message to console
* *
@ -41,6 +46,11 @@ public interface Logger {
*/ */
void error(String message); void error(String message);
/**
* Logs an error message and an exception to console
*/
void error(String message, Throwable error);
/** /**
* Logs a warning message to console * Logs a warning message to console
* *

Datei anzeigen

@ -121,7 +121,7 @@ public class GeyserConnector implements Connector {
config = FileUtils.loadConfig(configFile, GeyserConfiguration.class); config = FileUtils.loadConfig(configFile, GeyserConfiguration.class);
} catch (IOException ex) { } catch (IOException ex) {
logger.severe("Failed to read/create config.yml! Make sure it's up to date and/or readable+writable!"); logger.severe("Failed to read/create config.yml! Make sure it's up to date and/or readable+writable!", ex);
shutdown(); shutdown();
} }

Datei anzeigen

@ -93,12 +93,24 @@ public class GeyserLogger implements org.geysermc.api.logger.Logger {
System.out.println(printConsole(ChatColor.DARK_RED + message, colored)); System.out.println(printConsole(ChatColor.DARK_RED + message, colored));
} }
@Override
public void severe(String message, Throwable error) {
waitFor();
System.out.println(printConsole(ChatColor.DARK_RED + message + "\n" + error.getMessage(), colored));
}
@Override @Override
public void error(String message) { public void error(String message) {
waitFor(); waitFor();
System.out.println(printConsole(ChatColor.RED + message, colored)); System.out.println(printConsole(ChatColor.RED + message, colored));
} }
@Override
public void error(String message, Throwable error) {
waitFor();
System.out.println(printConsole(ChatColor.RED + message + "\n" + error.getMessage(), colored));
}
@Override @Override
public void warning(String message) { public void warning(String message) {
waitFor(); waitFor();