Package ch.njol.skript.log
Class RetainingLogHandler
java.lang.Object
ch.njol.skript.log.LogHandler
ch.njol.skript.log.RetainingLogHandler
- All Implemented Interfaces:
OpenCloseable
,Closeable
,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.njol.skript.log.LogHandler
LogHandler.LogResult
-
Field Summary
Fields inherited from interface ch.njol.util.OpenCloseable
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the list of retained log messages.@Nullable LogEntry
getFirstError
(String def) getLog()
int
boolean
void
onStop()
Called just after the handler is removed from the active handlers stack.final boolean
final boolean
printErrors
(@Nullable String def) Prints all retained errors or the given one if no errors were retained.final boolean
printErrors
(@Nullable String def, ErrorQuality quality) final boolean
printErrors
(org.bukkit.command.CommandSender recipient, @Nullable String def) Sends all retained error messages to the given recipient.final void
printLog()
Prints all retained log messages.int
size()
start()
A convenience method forSkriptLogger.startLogHandler(LogHandler)
.Methods inherited from class ch.njol.skript.log.LogHandler
close, isStopped, open, stop
-
Constructor Details
-
RetainingLogHandler
public RetainingLogHandler()
-
-
Method Details
-
log
- Specified by:
log
in classLogHandler
- Parameters:
entry
- entry to log- Returns:
- Whether to print the specified entry or not.
-
onStop
public void onStop()Description copied from class:LogHandler
Called just after the handler is removed from the active handlers stack.- Overrides:
onStop
in classLogHandler
-
start
Description copied from class:LogHandler
A convenience method forSkriptLogger.startLogHandler(LogHandler)
.
Implementations should override this to set the return type to the implementing class.- Overrides:
start
in classLogHandler
-
printErrors
public final boolean printErrors() -
printErrors
Prints all retained errors or the given one if no errors were retained.This handler is stopped if not already done.
- Parameters:
def
- Error to print if no errors were logged, can be null to not print any error if there are none- Returns:
- Whether there were any errors
-
printErrors
-
printErrors
public final boolean printErrors(org.bukkit.command.CommandSender recipient, @Nullable @Nullable String def) Sends all retained error messages to the given recipient.This handler is stopped if not already done.
- Parameters:
recipient
-def
- Error to send if no errors were logged, can be null to not print any error if there are none- Returns:
- Whether there were any errors to send
-
printLog
public final void printLog()Prints all retained log messages.This handler is stopped if not already done.
-
hasErrors
public boolean hasErrors() -
getFirstError
-
getFirstError
-
clear
public void clear()Clears the list of retained log messages. -
size
public int size() -
getLog
-
getErrors
-
getNumErrors
public int getNumErrors()
-