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.autoload(dir.resolve("modules"));
|
||||||
modulesManager.preInitModules();
|
modulesManager.preInitModules();
|
||||||
initGson();
|
initGson();
|
||||||
LogHelper.setStacktraceEnabled(true);
|
|
||||||
|
|
||||||
// Read LaunchServer config
|
// Read LaunchServer config
|
||||||
generateConfigIfNotExists();
|
generateConfigIfNotExists();
|
||||||
|
|
|
@ -11,22 +11,29 @@ public DebugCommand(LaunchServer server) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArgsDescription() {
|
public String getArgsDescription() {
|
||||||
return "[true/false]";
|
return "[true/false] (true/false)";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUsageDescription() {
|
public String getUsageDescription() {
|
||||||
return "Enable or disable debug logging at runtime";
|
return "Enable or disable debug and stacktrace logging at runtime";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invoke(String... args) {
|
public void invoke(String... args) {
|
||||||
boolean newValue;
|
boolean newValue, newTraceValue;
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
newValue = Boolean.parseBoolean(args[0]);
|
newValue = Boolean.parseBoolean(args[0]);
|
||||||
|
if(args.length >= 2) newTraceValue = Boolean.parseBoolean(args[1]);
|
||||||
|
else newTraceValue = newValue;
|
||||||
LogHelper.setDebugEnabled(newValue);
|
LogHelper.setDebugEnabled(newValue);
|
||||||
|
LogHelper.setStacktraceEnabled(newTraceValue);
|
||||||
} else
|
} else
|
||||||
|
{
|
||||||
newValue = LogHelper.isDebugEnabled();
|
newValue = LogHelper.isDebugEnabled();
|
||||||
|
newTraceValue = LogHelper.isStacktraceEnabled();
|
||||||
|
}
|
||||||
LogHelper.subInfo("Debug enabled: " + newValue);
|
LogHelper.subInfo("Debug enabled: " + newValue);
|
||||||
|
LogHelper.subInfo("Stacktrace enabled: " + newTraceValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue