Record Class FLogger
java.lang.Object
java.lang.Record
net.flectone.pulse.logging.FLogger
- Record Components:
logAdapter- hands a finished record to the platform loggerfileFacadeSupplier- supplies the config, which is not loaded yet when the logger is created
public record FLogger(LogAdapter logAdapter, Supplier<FileFacade> fileFacadeSupplier)
extends Record
The plugin's logger. It writes through the platform's own logger and, where the console
supports it, renders the colors a message carries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhether debug output is switched on by the system property.static final StringThe line asking the user to report an unexpected failure. -
Constructor Summary
ConstructorsConstructorDescriptionFLogger(LogAdapter logAdapter, Supplier<FileFacade> fileFacadeSupplier) Creates an instance of aFLoggerrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Config.Loggerconfig()The logger settings, or null while the config is still loading.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefileFacadeSupplierrecord component.final inthashCode()Returns a hash code value for this object.voidLogs a formatted message.voidLogs a message.voidLogs a message at the given level with formatting applied.voidlog(@NonNull com.alessiodp.libby.logging.LogLevel logLevel, @Nullable String string, @Nullable Throwable throwable) Logs a failure at the given level with formatting applied.Returns the value of thelogAdapterrecord component.voidLogs the plugin banner with its version and links.voidLogs that the plugin has shut down.voidLogs that the plugin is shutting down.voidLogs that the plugin has started.voidLogs that the plugin is starting up.voidLogs that a reload has finished.voidLogs that a reload has begun.final StringtoString()Returns a string representation of this record class.voidLogs a failure with its stack trace under a formatted message.voidLogs a formatted warning.voidLogs a warning, rendering the value as text.voidLogs a warning.voidLogs a failure with its stack trace under a message of your own.voidLogs a failure with its stack trace and a request to report it.
-
Field Details
-
DEBUG_ENABLED
public static final boolean DEBUG_ENABLEDWhether debug output is switched on by the system property. -
ERROR_MESSAGE_REPORT
The line asking the user to report an unexpected failure.- See Also:
-
-
Constructor Details
-
FLogger
Creates an instance of aFLoggerrecord class.- Parameters:
logAdapter- the value for thelogAdapterrecord componentfileFacadeSupplier- the value for thefileFacadeSupplierrecord component
-
-
Method Details
-
config
The logger settings, or null while the config is still loading.- Returns:
- the settings, or null
-
logEnabling
public void logEnabling()Logs that the plugin is starting up. -
logEnabled
public void logEnabled()Logs that the plugin has started. -
logDisabling
public void logDisabling()Logs that the plugin is shutting down. -
logDisabled
public void logDisabled()Logs that the plugin has shut down. -
logReloading
public void logReloading()Logs that a reload has begun. -
logReloaded
public void logReloaded()Logs that a reload has finished. -
logDescription
public void logDescription()Logs the plugin banner with its version and links. -
info
-
info
-
warning
Logs a warning, rendering the value as text.- Parameters:
object- the value
-
warning
-
warning
-
warning
-
warning
Logs a failure with its stack trace and a request to report it.- Parameters:
throwable- the failure
-
warning
-
log
Logs a message at the given level with formatting applied.- Parameters:
logLevel- the levelstring- the message
-
log
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
logAdapter
Returns the value of thelogAdapterrecord component.- Returns:
- the value of the
logAdapterrecord component
-
fileFacadeSupplier
Returns the value of thefileFacadeSupplierrecord component.- Returns:
- the value of the
fileFacadeSupplierrecord component
-