Package ch.njol.skript.log
Class SkriptLogger
java.lang.Object
ch.njol.skript.log.SkriptLogger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandebug()static @Nullable NodegetNode()static voidstatic booleanChecks whether messages should be logged for the given verbosity.static voidLogging should be done like this:static voidlogAll(Collection<LogEntry> entries) static voidlogTracked(Level level, String message, ErrorQuality quality) static voidsendFormatted(CommandSender commandSender, String message) Sends the given formatted message to the givenCommandSender.static voidstatic voidstatic <T extends LogHandler>
TstartLogHandler(T h) Starts a log handler.static ParseLogHandlerShorthand forstartLogHandler(newParseLogHandler());static RetainingLogHandlerShorthand forstartLogHandler(newRetainingLogHandler());
-
Field Details
-
SEVERE
-
DEBUG
-
LOGGER
-
-
Constructor Details
-
SkriptLogger
public SkriptLogger()
-
-
Method Details
-
startRetainingLog
Shorthand forstartLogHandler(newRetainingLogHandler());- Returns:
- A newly created RetainingLogHandler
-
startParseLogHandler
Shorthand forstartLogHandler(newParseLogHandler());- Returns:
- A newly created ParseLogHandler
-
startLogHandler
Starts a log handler.This should be used like this:
try (LogHandler handler = SkriptLogger.startLogHandler(new ...LogHandler())) { doSomethingThatLogsMessages(); // do something with the logged messages }- Returns:
- The passed LogHandler
- See Also:
-
setVerbosity
-
debug
public static boolean debug() -
setNode
-
getNode
-
log
Logging should be done like this:if (Skript.logNormal()) Skript.info("this information is displayed on verbosity normal or higher");- Parameters:
level-message-- See Also:
-
log
-
logAll
-
logTracked
-
log
Checks whether messages should be logged for the given verbosity.- Parameters:
minVerb- minimal verbosity- Returns:
- Whether messages should be logged for the given verbosity.
-
sendFormatted
Sends the given formatted message to the givenCommandSender.
-