mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Команда debug для stacktrace
This commit is contained in:
parent
baaf2ec74e
commit
e525842d24
2 changed files with 10 additions and 4 deletions
|
@ -374,7 +374,6 @@ public LaunchServer(Path dir) throws IOException, InvalidKeySpecException {
|
|||
modulesManager.autoload(dir.resolve("modules"));
|
||||
modulesManager.preInitModules();
|
||||
initGson();
|
||||
LogHelper.setStacktraceEnabled(true);
|
||||
|
||||
// Read LaunchServer config
|
||||
generateConfigIfNotExists();
|
||||
|
|
|
@ -11,22 +11,29 @@ public DebugCommand(LaunchServer server) {
|
|||
|
||||
@Override
|
||||
public String getArgsDescription() {
|
||||
return "[true/false]";
|
||||
return "[true/false] (true/false)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsageDescription() {
|
||||
return "Enable or disable debug logging at runtime";
|
||||
return "Enable or disable debug and stacktrace logging at runtime";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(String... args) {
|
||||
boolean newValue;
|
||||
boolean newValue, newTraceValue;
|
||||
if (args.length >= 1) {
|
||||
newValue = Boolean.parseBoolean(args[0]);
|
||||
if(args.length >= 2) newTraceValue = Boolean.parseBoolean(args[1]);
|
||||
else newTraceValue = newValue;
|
||||
LogHelper.setDebugEnabled(newValue);
|
||||
LogHelper.setStacktraceEnabled(newTraceValue);
|
||||
} else
|
||||
{
|
||||
newValue = LogHelper.isDebugEnabled();
|
||||
newTraceValue = LogHelper.isStacktraceEnabled();
|
||||
}
|
||||
LogHelper.subInfo("Debug enabled: " + newValue);
|
||||
LogHelper.subInfo("Stacktrace enabled: " + newTraceValue);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue