public final class Debugger extends Object
Logging
class instead.Modifier and Type | Class and Description |
---|---|
static class |
Debugger.ExceptionHandler
|
Modifier and Type | Method and Description |
---|---|
static void |
error(Throwable error,
String message,
Object... args)
|
static void |
hideErrors(boolean hide)
Sets whether or not calls to
error(Throwable, String, Object...) will print errors. |
static void |
hookBukkit()
Hooks into Bukkit's plugin system and adds a handler to all plugin
loggers to allow catching unreported exceptions.
|
static void |
print(Level level,
String format,
Object... args)
|
static void |
print(String format,
Object... args)
|
static void |
setReportingURL(String url)
Sets the URL to send a JSON payload of server information to as well as
any other relevant information for when a stack trace occurs.
|
static void |
toggleOutput(boolean output)
Sets whether or not to actually output any calls from your plugin to the
Debugger.
|
public static void hookBukkit()
IllegalPluginAccessException
- If something other than
CodelanxLib
calls this
methodpublic static void setReportingURL(String url)
null
, and as a result will not send any information upon
errors occurring unless a target URL is set.url
- The URL to send JSON payloads topublic static void toggleOutput(boolean output)
false
.output
- true
if calls to the Debugger should print outpublic static void hideErrors(boolean hide)
error(Throwable, String, Object...)
will print errors.
This is distinct from toggleOutput(boolean)
and errors
will not depend on its value. This defaults to false
.hide
- true
if errors should be printedpublic static void print(Level level, String format, Object... args)
level
- The Level
to print atformat
- The formatting stringargs
- The printf argumentspublic static void print(String format, Object... args)
format
- The formatting stringargs
- The printf argumentspublic static void error(Throwable error, String message, Object... args)
Logger
at Level.SEVERE
if
toggleOutput(boolean)
is set to true
. It will
also report the error with the URL set via
setReportingURL(String)
. If that is null
,
nothing will be reportederror
- The Throwable
to be printedmessage
- The formatting stringargs
- The formatting argumentsCopyright © 2015. All rights reserved.