### LoggerAide Constructor Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerAide Constructs a new LoggerAide instance with the specified configuration. This allows for dual output to the console and optional file logging. ```APIDOC ## LoggerAide Constructor ### Description Constructs LoggerAide with console and optional file logging. ### Method `public LoggerAide(LoggerConfig config)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "config": { /* LoggerConfig object */ } } ``` ### Response #### Success Response (200) LoggerAide instance is created. #### Response Example ```json { "message": "LoggerAide initialized successfully" } ``` ``` -------------------------------- ### Logger Configuration API Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/class-use/LoggerConfig.Builder This section details the methods available for configuring the Logger Aide, primarily through the LoggerConfig.Builder class. It covers setting up console prefixes, file logging, log levels, file rotation, and formatting. ```APIDOC ## LoggerConfig.Builder API ### Description Provides methods to configure logger settings, including console output, file logging, log levels, and file rotation. ### Method `static LoggerConfig.Builder` ### Endpoint N/A (This is a library configuration API, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body N/A ### Request Example ```java LoggerConfig.Builder builder = LoggerConfig.builder("myLogger", Paths.get("/var/log")); ``` ### Response #### Success Response (Builder Instance) - **LoggerConfig.Builder** (LoggerConfig.Builder) - An instance of the builder for further configuration. #### Response Example ```java LoggerConfig.Builder builder = LoggerConfig.builder("myLogger", Paths.get("/var/log")); ``` ## Builder Methods ### `consolePrefix(Component consolePrefix)` Sets a custom prefix for console output. ### `fileLoggingEnabled(boolean fileLoggingEnabled)` Enables or disables file logging. ### `fileLogLevel(Level fileLogLevel)` Sets the minimum level for messages to be written to the log file. ### `logFileCount(int logFileCount)` Sets the number of log files to keep during rotation. ### `logFileNamePattern(String logFileNamePattern)` Sets the naming pattern for log files. ### `logFileSizeLimitBytes(int logFileSizeLimitBytes)` Sets the maximum size of a log file before rotation. ### `miniMessage(MiniMessage miniMessage)` Sets a MiniMessage instance for formatting log messages. ### `usePaperStyleFileFormatter(boolean usePaperStyleFileFormatter)` Enables or disables the use of Paper-style file formatting. ``` -------------------------------- ### LoggerConfig.Builder Methods Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig.Builder Methods for configuring various aspects of the LoggerConfig, such as console prefix, file logging, log file naming, size limits, and formatting. ```APIDOC ## LoggerConfig.Builder Methods ### Description Methods for configuring logger settings. ### Method Instance Methods ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Details * ### consolePrefix public LoggerConfig.Builder consolePrefix(Component consolePrefix) * **consolePrefix** (Component) - Optional - Sets the prefix for console output. * ### miniMessage public LoggerConfig.Builder miniMessage(MiniMessage miniMessage) * **miniMessage** (MiniMessage) - Optional - Sets the MiniMessage instance for formatting. * ### fileLoggingEnabled public LoggerConfig.Builder fileLoggingEnabled(boolean fileLoggingEnabled) * **fileLoggingEnabled** (boolean) - Optional - Enables or disables file logging. * ### logFileNamePattern public LoggerConfig.Builder logFileNamePattern(String logFileNamePattern) * **logFileNamePattern** (String) - Optional - Sets the pattern for log file names. * ### logFileSizeLimitBytes public LoggerConfig.Builder logFileSizeLimitBytes(int logFileSizeLimitBytes) * **logFileSizeLimitBytes** (int) - Optional - Sets the maximum size of a log file in bytes. * ### logFileCount public LoggerConfig.Builder logFileCount(int logFileCount) * **logFileCount** (int) - Optional - Sets the number of log files to retain. * ### usePaperStyleFileFormatter public LoggerConfig.Builder usePaperStyleFileFormatter(boolean usePaperStyleFileFormatter) * **usePaperStyleFileFormatter** (boolean) - Optional - Enables or disables the use of Paper-style file formatting. * ### fileLogLevel public LoggerConfig.Builder fileLogLevel(Level fileLogLevel) * **fileLogLevel** (Level) - Optional - Sets the minimum logging level for file output. ### Build Method * ### build public LoggerConfig build() * Description: Constructs and returns a `LoggerConfig` object with the configured settings. ``` -------------------------------- ### LoggerConfig.Builder Constructor Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig.Builder Initializes a new instance of the LoggerConfig.Builder class with the specified logger name and log directory. ```APIDOC ## LoggerConfig.Builder Constructor ### Description Initializes a new instance of the LoggerConfig.Builder class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Constructor Details * ### Builder public Builder(String loggerName, Path logDirectory) * **loggerName** (String) - Required - The name of the logger. * **logDirectory** (Path) - Required - The directory where logs will be stored. ``` -------------------------------- ### Logging Methods Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerAide Provides methods for logging messages at different levels (info, warn, error, debug) with support for plain strings and Adventure Components. ```APIDOC ## Logging Methods ### Description Methods for logging messages at various levels. Supports plain strings with optional arguments or Throwable, and Adventure Components with optional Throwables. ### Methods #### `info(String message, Object... args)` Logs an informational message with optional arguments. #### `info(Component message)` Logs an informational message using an Adventure Component. #### `warn(String message, Object... args)` Logs a warning message with optional arguments. #### `warn(Component message)` Logs a warning message using an Adventure Component. #### `error(String message, Object... args)` Logs an error message with optional arguments. #### `error(String message, Throwable throwable, Object... args)` Logs an error message with optional arguments and a Throwable. #### `error(Component message)` Logs an error message using an Adventure Component. #### `error(Component message, Throwable throwable)` Logs an error message using an Adventure Component and a Throwable. #### `debug(String message, Object... args)` Logs a debug message with optional arguments. #### `debug(String message, Throwable throwable, Object... args)` Logs a debug message with optional arguments and a Throwable. #### `debug(Component message)` Logs a debug message using an Adventure Component. #### `debug(Component message, Throwable throwable)` Logs a debug message using an Adventure Component and a Throwable. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (Methods operate on provided message/throwable arguments) ### Request Example ```json // For info(String message, Object... args) { "message": "User logged in: %s", "args": ["username"] } // For info(Component message) { "message": { /* Adventure Component object */ } } ``` ### Response #### Success Response (200) Log message is processed and outputted to configured destinations. #### Response Example ```json { "status": "logged", "level": "info" } ``` ``` -------------------------------- ### LoggerConfig Builder Creation Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig Provides a static method to create a builder for LoggerConfig. This is a convenient way to construct a LoggerConfig object, especially when many parameters are involved. The builder pattern helps in creating complex objects step by step. ```java public static LoggerConfig.Builder builder(String loggerName, Path logDirectory) ``` -------------------------------- ### LoggerConfig Constructor Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig The canonical constructor for LoggerConfig, used to initialize all logging parameters. It takes arguments for logger name, console prefix, MiniMessage instance, file logging enablement, log directory, file name pattern, file size limit, file count, formatter style, and file log level. ```java public LoggerConfig(String loggerName, Component consolePrefix, MiniMessage miniMessage, boolean fileLoggingEnabled, Path logDirectory, String logFileNamePattern, int logFileSizeLimitBytes, int logFileCount, boolean usePaperStyleFileFormatter, Level fileLogLevel) ``` -------------------------------- ### BukkitFormatter Default Constructor (Java) Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/file/BukkitFormatter Constructs a new BukkitFormatter using the log record's logger name. This formatter mimics the Bukkit console format. ```java public BukkitFormatter() Constructs a new BukkitFormatter using the record's logger name. ``` -------------------------------- ### LoggerConfig Record Definition and Usage Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig Defines the LoggerConfig record, which holds all settings for initializing LoggerAide. It includes components for logger name, console prefix, file logging enablement, log directory, file naming patterns, size limits, rotation count, formatter style, and file log level. This record is immutable and created via its canonical constructor or a builder pattern. ```java public record LoggerConfig(String loggerName, Component consolePrefix, MiniMessage miniMessage, boolean fileLoggingEnabled, Path logDirectory, String logFileNamePattern, int logFileSizeLimitBytes, int logFileCount, boolean usePaperStyleFileFormatter, Level fileLogLevel) extends Record ``` -------------------------------- ### LoggerConfig Standard Object Methods Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig Standard Java object methods overridden for the LoggerConfig record class. This includes toString for a string representation, hashCode for hash code generation, and equals for object comparison based on record components. ```java public final String toString() public final int hashCode() public final boolean equals(Object o) ``` -------------------------------- ### LoggerConfig Record Component Accessors Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerConfig Methods to retrieve the values of individual record components within a LoggerConfig instance. These include loggerName, consolePrefix, miniMessage, fileLoggingEnabled, logDirectory, logFileNamePattern, logFileSizeLimitBytes, logFileCount, usePaperStyleFileFormatter, and fileLogLevel. ```java public String loggerName() public Component consolePrefix() public MiniMessage miniMessage() public boolean fileLoggingEnabled() public Path logDirectory() public String logFileNamePattern() public int logFileSizeLimitBytes() public int logFileCount() public boolean usePaperStyleFileFormatter() public Level fileLogLevel() ``` -------------------------------- ### BukkitFormatter Constructor with Logger Name (Java) Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/file/BukkitFormatter Constructs a new BukkitFormatter with a specific logger name to be displayed in the formatted log record. If the provided logger name is null, the LogRecord's logger name will be used. ```java public BukkitFormatter(String loggerNameToDisplay) Constructs a new BukkitFormatter with a specific logger name. Parameters: `loggerNameToDisplay` - the logger name to display in the formatted log record. If null, `LogRecord.getLoggerName()` will be used. ``` -------------------------------- ### BukkitFormatter Format Method (Java) Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/file/BukkitFormatter Formats a given LogRecord into a string representation. This method is specified by the Formatter class and adheres to the Bukkit console format. ```java public String format(LogRecord record) Formats the given log record. Specified by: `format` in class `Formatter` Parameters: `record` - the log record to be formatted Returns: the formatted log record string ``` -------------------------------- ### Close Method Source: https://javadoc.io/doc/in.arcadelabs.labaide/logger-aide/1.0/in/arcadelabs/labaide/logger/LoggerAide Closes any open resources managed by LoggerAide, such as file handlers. This method should be called during application or plugin shutdown. ```APIDOC ## Close Method ### Description Closes any open resources, such as file handlers. This should be called when the application/plugin is shutting down. ### Method `public void close()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json // No request body for this method ``` ### Response #### Success Response (200) Resources are closed. #### Response Example ```json { "message": "LoggerAide resources closed successfully" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.