Package me.deecaad.core.utils
Class Debugger
java.lang.Object
me.deecaad.core.utils.Debugger
This class outlines an easier to use version of a
Logger. Debuggers have the advantage of
only displaying specific messages based on which LogLevel is currently being used. This
means that debug messages are only shown when the user wants to see debug messages, and errors
are shown if users want errors to be shown.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the givenLogLevelcan be logged based on the currently set numeric logging level.voidShorthand for usinglog(LogLevel, String...)at debugging level.voidShorthand for usinglog(LogLevel, String...)at error level.intgetLevel()Gets the current numeric logging level that was input by the user.Returns the backingLoggerthat belongs to the plugin that instantiated this debugger.voidShorthand for usinglog(LogLevel, String...)at information level.voidLogs the given messages to console at the givenLogLevel.voidLogs the given message and the given exception at the givenLogLevel.voidLogs the given exception to console at the givenLogLevel.voidvoidsetLevel(int level) Sets the numeric logging that.voidstart(com.cjcrafter.foliascheduler.ServerImplementation impl) voidstart(org.bukkit.plugin.Plugin plugin) Deprecated.voidvoidvoidShorthand for usinglog(LogLevel, String...)at warning level.
-
Field Details
-
msg
-
permission
-
updateTime
public long updateTime
-
-
Constructor Details
-
Debugger
-
Debugger
-
-
Method Details
-
getLogger
Returns the backingLoggerthat belongs to the plugin that instantiated this debugger.- Returns:
- The non-null
Logger
-
getLevel
public int getLevel()Gets the current numeric logging level that was input by the user.- Returns:
- The non-negative numeric logging level.
-
setLevel
public void setLevel(int level) Sets the numeric logging that. This level should be set by the user.- Parameters:
level- The non-negative numeric logging level.
-
canLog
Returnstrueif the givenLogLevelcan be logged based on the currently set numeric logging level.- Parameters:
level- The non-nullLogLevelto test.- Returns:
trueif thelevelcan be logged.
-
debug
Shorthand for usinglog(LogLevel, String...)at debugging level.- Parameters:
msg- The non-null messages to log.- See Also:
-
info
Shorthand for usinglog(LogLevel, String...)at information level.- Parameters:
msg- The non-null messages to log.- See Also:
-
warn
Shorthand for usinglog(LogLevel, String...)at warning level.- Parameters:
msg- The non-null messages to log.- See Also:
-
error
Shorthand for usinglog(LogLevel, String...)at error level.- Parameters:
msg- The non-null messages to log.- See Also:
-
log
-
log
Logs the given messages to console at the givenLogLevel.- Parameters:
level- The non-null level to log the messages.msg- The non-null messages to log.
-
log
Logs the given exception to console at the givenLogLevel.- Parameters:
level- The non-null level to log the messages.error- The non-null exception to log.
-
log
Logs the given message and the given exception at the givenLogLevel. If the exception does not have a message, themsgis used as the message. Otherwise, they are logged separately.- Parameters:
level- The non-null level to log the messages.msg- The message to log.error- The exception to log.
-
validate
- Parameters:
bool- The condition to check for. If this istrue, the messages are not logged.messages- The messages to log as an error.
-
validate
- Parameters:
level- The logging level to log the messages.bool- The condition to check for. If this istrue, the messages are not logged.messages- The messages to log.
-
start
Deprecated.Starts the warning runnable which warns opped users if an error occurs in console.- Parameters:
plugin- The plugin to schedule the task.
-
start
public void start(com.cjcrafter.foliascheduler.ServerImplementation impl)
-