mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-03 22:21:30 +01:00
Chore: codestyle changes
This commit is contained in:
parent
1fef714b8f
commit
17dff457b2
@ -158,21 +158,26 @@ public class DumpsCommand extends MultiverseCommand {
|
|||||||
|
|
||||||
if (!logsFile.exists()) {
|
if (!logsFile.exists()) {
|
||||||
Logging.warning("Could not read logs/latest.log");
|
Logging.warning("Could not read logs/latest.log");
|
||||||
return "Could not read ./logs/latest.log";
|
return "Could not find log";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try reading as ANSI encoded
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Files.readString(logsPath, StandardCharsets.ISO_8859_1);
|
return Files.readString(logsPath, StandardCharsets.ISO_8859_1);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// UTF-8 encoded log
|
Logging.finer("Log is not ANSI encoded. Trying UTF-8");
|
||||||
try {
|
// Must be a UTF-8 encoded log then
|
||||||
return Files.readString(logsPath, StandardCharsets.UTF_8);
|
|
||||||
} catch (IOException ex) {
|
}
|
||||||
// It is some other strange encoding
|
|
||||||
throw new RuntimeException(ex);
|
// Try reading as UTF-8 encoded
|
||||||
}
|
try {
|
||||||
|
return Files.readString(logsPath, StandardCharsets.UTF_8);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
// It is some other strange encoding
|
||||||
|
Logging.severe("Could not read ./logs/latest.log. See below for stack trace");
|
||||||
|
ex.printStackTrace();
|
||||||
|
return "Could not read log";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user