Class Knob
- java.lang.Object
-
- net.kyori.adventure.platform.facet.Knob
-
public final class Knob extends Object
Facet utilities and logging pipeline.This is not supported API. Subject to change at any time.
- Since:
- 4.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEnabled(@NotNull String key, boolean defaultValue)Gets whether a facet should be enabled.static voidlogError(@Nullable Throwable error, @NotNull String format, @NotNull Object... arguments)Logs an error.static voidlogMessage(@NotNull String format, @NotNull Object... arguments)Logs a message.static voidlogUnsupported(@NotNull Object facet, @NotNull Object value)Logs an unsupported value.
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
-
ERR
public static volatile BiConsumer<String,Throwable> ERR
-
-
Method Detail
-
isEnabled
public static boolean isEnabled(@NotNull @NotNull String key, boolean defaultValue)Gets whether a facet should be enabled.Use the JVM flag,
-Dnet.kyori.adventure.<key>=true, to enable the facet.- Parameters:
key- a keydefaultValue- the default value- Returns:
- if the feature is enabled
- Since:
- 4.0.0
-
logError
public static void logError(@Nullable @Nullable Throwable error, @NotNull @NotNull String format, @NotNull @NotNull Object... arguments)Logs an error.- Parameters:
error- an errorformat- a string formatarguments- an array of arguments- Since:
- 4.0.0
-
logMessage
public static void logMessage(@NotNull @NotNull String format, @NotNull @NotNull Object... arguments)Logs a message.- Parameters:
format- a string formatarguments- an array of arguments- Since:
- 4.0.0
-
-