Skip to content

Commit

Permalink
Debug Extra Info option
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 15, 2022
1 parent cc20a85 commit 22a1587
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Expand Up @@ -19,6 +19,7 @@ public static void refillCache() {
// Core
CoreConfiguration.defaultDebugMode = config.getBoolean("Debug.Show", true);
com.denizenscript.denizen.utilities.debugging.Debug.showDebug = CoreConfiguration.defaultDebugMode;
CoreConfiguration.debugExtraInfo = config.getBoolean("Debug.Extra info", false);
CoreConfiguration.debugVerbose = config.getBoolean("Debug.Verbose", false);
CoreConfiguration.debugLoadingInfo = config.getBoolean("Debug.Show loading info", false);
CoreConfiguration.deprecationWarningRate = config.getLong("Debug.Warning rate", config.getLong("Tags.Warning rate", 10000));
Expand Down
Expand Up @@ -116,7 +116,8 @@ public void submit(CommandContext args, final CommandSender sender) throws Comma
// '-p' enables/disables packet debug logging. When enabled, all packets sent to players (from anywhere) will be logged to console.
// or, '--pfilter (filter)' to enable packet debug logging with a string contain filter.
// '-f' enables/disables showing of future warnings. When enabled, future warnings (such as upcoming deprecations) will be displayed in console logs.
// '-v' enables/disables advanced verbose log output. This will *flood* your console super hard.
// '-e' enables/disables extra output. This will spam more information about various internal things.
// '-v' enables/disables advanced ultra-verbose log output. This will *flood* your console super hard.
// '-o' enables/disables 'override' mode. This will display all script debug, even when 'debug: false' is set for scripts.
// '-l' enables/disables script loading information. When enabled, '/ex reload' will produce a potentially large amount of debug output.
//
Expand All @@ -128,7 +129,7 @@ public void submit(CommandContext args, final CommandSender sender) throws Comma
@Command(
aliases = {"denizen"}, usage = "debug",
desc = "Toggles debug mode for Denizen.", modifiers = {"debug", "de", "db", "dbug"},
min = 1, max = 5, permission = "denizen.debug", flags = "scbrovnipfl")
min = 1, max = 5, permission = "denizen.debug", flags = "scbroevnipfl")
public void debug(CommandContext args, CommandSender sender) throws CommandException {
if (args.hasFlag('s')) {
if (!Debug.showDebug) {
Expand Down Expand Up @@ -171,6 +172,14 @@ public void debug(CommandContext args, CommandSender sender) throws CommandExcep
Messaging.sendInfo(sender, (Debug.record ? "Denizen debugger is now recording. Use /denizen " +
"submit to finish." : "Denizen debugger recording disabled."));
}
if (args.hasFlag('e')) {
if (!Debug.showDebug) {
Debug.toggle();
}
CoreConfiguration.debugExtraInfo = !CoreConfiguration.debugExtraInfo;
Messaging.sendInfo(sender, (CoreConfiguration.debugExtraInfo ? "Denizen debugger is now showing extra internal information." :
"Denizen debugger extra-info disabled."));
}
if (args.hasFlag('v')) {
if (!Debug.showDebug) {
Debug.toggle();
Expand Down
4 changes: 3 additions & 1 deletion plugin/src/main/resources/config.yml
Expand Up @@ -28,7 +28,9 @@ Debug:
# This is available as a backup safety feature to prevent debug output from crashing a server.
# Set the value lower to better protect this, set the value higher to willfully debug a very very long script.
Limit per tick: 5000
# Whether to show extra 'verbose' info output (will FLOOD your console!).
# Whether to show some extra info output (will spam your console).
Extra info: false
# Whether to show extra advanced detailed 'verbose' info output (will FLOOD your console!).
Verbose: false
# Optional text to prefix all debug output.
Prefix: ""
Expand Down

0 comments on commit 22a1587

Please sign in to comment.