Package dev.majek.hexnicks.util
Class LoggingManager
java.lang.Object
dev.majek.hexnicks.util.LoggingManager
Manages plugin logging. This includes printing log message, saving to file,
and uploading to pastes.dev.
-
Constructor Summary
ConstructorDescriptionLoggingManager
(@NotNull org.bukkit.plugin.Plugin plugin, @Nullable File directory) Create a new logging manager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Log a debug message.void
Log a debug message and send it to a user.boolean
doDebug()
Whether debugging message should be sent.void
doDebug
(boolean debug) Set whether to send debugging messages.void
Log an error.void
Log an error and it's exception.@NotNull String
Get the latest log from the latest file.Get the latest log file being used.@NotNull String
Publish the latest log to pastes.dev.void
Log a simple message.
-
Constructor Details
-
LoggingManager
public LoggingManager(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @Nullable @Nullable File directory) Create a new logging manager.- Parameters:
plugin
- the plugin for which logging will be manageddirectory
- the directory to store logs in set this to null if log files shouldn't be kept
-
-
Method Details
-
log
Log a simple message.- Parameters:
message
- the message
-
error
Log an error. This should be something severe.- Parameters:
message
- the error message
-
error
Log an error and it's exception.- Parameters:
message
- the error messagethrowable
- the exception
-
debug
Log a debug message. This will only log ifdebug
is set to true.- Parameters:
message
- the message
-
debug
public void debug(@NotNull @NotNull String message, @NotNull @NotNull net.kyori.adventure.audience.Audience audience) Log a debug message and send it to a user. This will only log ifdebug
is set to true.- Parameters:
message
- the messageaudience
- the user to send the message to
-
latestToPasteBin
Publish the latest log to pastes.dev.- Returns:
- the link to the log on the site
-
latestLog
Get the latest log from the latest file.- Returns:
- the latest log
-
latestLogFile
Get the latest log file being used.- Returns:
- the latest log file
-
doDebug
public boolean doDebug()Whether debugging message should be sent.- Returns:
- debugging status
-
doDebug
public void doDebug(boolean debug) Set whether to send debugging messages.- Parameters:
debug
- debugging status
-