export type LoggerType = "Plugin" | "Coremod" | "API" | "Ignition" | "CommonModules" | "Components" | "Manager"; export type LogLevel = "log" | "warn" | "error" | "info" | "debug"; /** * Logs a message to the console with a Replugged prefix. * @param type The context type of this log message, e.g. "Plugin" or "Coremod". * @param name The context name of this log message, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @param data The item(s) to log. */ export declare const log: (type: LoggerType, name: string, color?: string, ...data: Parameters) => void; /** * Logs a warning message to the console with a Replugged prefix. * @param type The context type of this log message, e.g. "Plugin" or "Coremod". * @param name The context name of this log message, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @param data The item(s) to log. */ export declare const warn: (type: LoggerType, name: string, color?: string, ...data: Parameters) => void; /** * Logs an error message to the console with a Replugged prefix. * @param type The context type of this log message, e.g. "Plugin" or "Coremod". * @param name The context name of this log message, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @param data The item(s) to log. */ export declare const error: (type: LoggerType, name: string, color?: string, ...data: Parameters) => void; /** * Logs an informational message to the console with a Replugged prefix. * @param type The context type of this log message, e.g. "Plugin" or "Coremod". * @param name The context name of this log message, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @param data The item(s) to log. */ export declare const info: (type: LoggerType, name: string, color?: string, ...data: Parameters) => void; /** * Logs a verbose message to the console with a Replugged prefix. * @param type The context type of this log message, e.g. "Plugin" or "Coremod". * @param name The context name of this log message, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @param data The item(s) to log. */ export declare const verbose: (type: LoggerType, name: string, color?: string, ...data: Parameters) => void; /** * A convenient way to manage logging things to the console with colorful prefixes indicating their context. * Each `Logger` instance stores its context type, context name, and prefix color, * so you can use its {@link Logger.log log}, {@link Logger.warn warn}, and {@link Logger.error error} * methods in the same manner that you would use the `console` methods with the same names. The prefix * will be generated and prepended to the appropriate console message automatically. * * If you are only logging a single message with a prefix in your plugin, you may use {@link log}, {@link warn}, or {@link error} * instead of creating a `Logger`. Otherwise, using this class is much more convenient than specifying * the type, name, and color for every message. * @example * ```ts * import { Logger } from "replugged"; * * const pluginLogger = Logger.plugin("SilentTyping"); * pluginLogger.log("Hello", "world"); // Logs `[Replugged:Plugin:SilentTyping] Hello world` * ``` */ export declare class Logger { type: LoggerType; name: string; color: string; /** * @param type The context type of this logger, e.g. "Plugin" or "Coremod". * @param name The context name of this logger, e.g. the name of the plugin or coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. */ constructor(type: LoggerType, name: string, color?: string); /** * Logs a message at the "log" level, which is the default logging level. * This is useful for logging general messages that are not warnings or errors. * @param data The item(s) to log. */ log(...data: Parameters): void; /** * Logs a message at the "warn" level, which is visually distinct from regular logs. * This is useful for logging warning messages that indicate a potential issue or something that should be noted, but may not necessarily be a problem. * @param data The item(s) to log. */ warn(...data: Parameters): void; /** * Logs a message at the "error" level, which is visually distinct from regular logs and warnings. * This is useful for logging error messages that indicate a failure or problem that needs attention. * @param data The item(s) to log. */ error(...data: Parameters): void; /** * Logs a message at the "info" level, which is visually distinct from regular logs. * This is useful for logging informational messages that are more important than regular logs, but not as severe as warnings or errors. * @param data The item(s) to log. */ info(...data: Parameters): void; /** * Logs a message at the "verbose" level, which is only visible when verbose logging is enabled in the console. * This is useful for logging detailed information that may be too noisy for regular logging, but can be helpful for debugging. * @param data The item(s) to log. */ verbose(...data: Parameters): void; /** * Convenience method to create a new {@link Logger} for an API. * @param name The name of the API. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @returns A {@link Logger} instance with the type set to "API". * @internal */ static api(name: string, color?: string): Logger; /** * Convenience method to create a new {@link Logger} for a coremod. * @param name The name of the coremod. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @returns A {@link Logger} instance with the type set to "Coremod". * @internal */ static coremod(name: string, color?: string): Logger; /** * Convenience method to create a new {@link Logger} for a manager. * @param name The name of the manager. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @returns A {@link Logger} instance with the type set to "Manager". * @internal */ static manager(name: string, color?: string): Logger; /** * Convenience method to create a new {@link Logger} for a plugin. * @param name The name of the plugin. * @param color The color of the prefix. This should be a valid CSS color string. If not specified, it defaults to a blurple color. * @returns A {@link Logger} instance with the type set to "Plugin". */ static plugin(name: string, color?: string): Logger; }