Package ch.njol.skript.log
Class ParseLogHandler
java.lang.Object
ch.njol.skript.log.LogHandler
ch.njol.skript.log.ParseLogHandler
- 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 TypeMethodDescriptionbackup()
Internal method for creating a backup of this log.void
clear()
Clears all log messages except for the errorvoid
void
error
(String error, ErrorQuality quality) @Nullable LogEntry
getError()
int
boolean
hasError()
void
void
printError
(@Nullable String def) Prints the best error or the given error if no error has been logged.void
printError
(String def, ErrorQuality quality) void
printLog()
Prints the retained logvoid
printLog
(boolean includeErrors) void
restore
(ParseLogHandler parseLogHandler) Internal method for restoring a backup of this log.start()
A convenience method forSkriptLogger.startLogHandler(LogHandler)
.
-
Constructor Details
-
ParseLogHandler
public ParseLogHandler()
-
-
Method Details
-
backup
Internal method for creating a backup of this log.- Returns:
- A new ParseLogHandler containing the contents of this ParseLogHandler.
-
restore
Internal method for restoring a backup of this log. -
log
- Specified by:
log
in classLogHandler
- Parameters:
entry
- entry to log- Returns:
- Whether to print the specified entry or not.
-
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
-
error
-
clear
public void clear()Clears all log messages except for the error -
clearError
public void clearError() -
printLog
public void printLog()Prints the retained log -
printLog
public void printLog(boolean includeErrors) -
printError
public void printError() -
printError
Prints the best error or the given error if no error has been logged.- Parameters:
def
- Error to log if no error has been logged so far, can be null
-
printError
-
getNumErrors
public int getNumErrors() -
hasError
public boolean hasError() -
getError
-