import type { LogLevel } from "../../types/index.js"; /** * LoggerService - Singleton para logging * Aplica el patrón Singleton para garantizar una única instancia de logger. */ export declare class LoggerService { private static instance; /** Optional prefix prepended to every message. Empty = no prefix (default). */ private context; /** * Constructor privado - enforce singleton */ private constructor(); /** * Obtiene la instancia única del LoggerService (Singleton) */ static getInstance(): LoggerService; /** * Configura el prefijo de contexto. Vacío ("") lo elimina. */ useSetContext(context: string): void; /** Builds the effective message: `[context] message` only when a context is set. */ private useFormat; /** * Logs a message with optional data and level. * Maps directly onto the native `console` methods (`log`, `warn`, `error`). * * @param message - The message to log. * @param data - Optional data to attach to the log. * @param level - The log level. Defaults to `"log"`. * * @example * ```ts * import { useLogger } from "katanakit-js"; * * useLogger("Application started"); * useLogger("Cache miss", undefined, "warn"); * useLogger("Database timeout", { query: "SELECT 1" }, "error"); * ``` */ useLog(message: string, data?: unknown, level?: LogLevel): void; /** * Logs a message at the "warn" level. * * @param message - The message to log. * @param data - Optional data to attach to the log. * * @example * ```ts * useLogWarn("Cache miss", { key: "user:123" }); * ``` */ useLogWarn(message: string, data?: unknown): void; /** * Logs a message at the "error" level. * * @param message - The message to log. * @param data - Optional error data to attach to the log. * * @example * ```ts * useLogError("Database timeout", { query: "SELECT 1", duration: 5000 }); * ``` */ useLogError(message: string, data?: unknown): void; /** * Clears the console. * * @example * ```ts * useLoggerClear(); * ``` */ useClear(): void; /** * Displays tabular data in the console. * * @param data - The data to display as a table. * * @example * ```ts * useLoggerTable([{ id: 1, name: "Alice" }, { id: 2, name: "Bob" }]); * ``` */ useTable(data: unknown): void; } /** * Wrapper para LoggerService - mantiene backward compatibility */ export declare function useLogger(message: string, data?: unknown, level?: LogLevel): void; /** * Wrapper para LoggerService - mantiene backward compatibility */ export declare function useLoggerWarn(message: string, data?: unknown): void; /** * Wrapper para LoggerService - mantiene backward compatibility */ export declare function useLoggerError(message: string, data?: unknown): void; /** * Wrapper para LoggerService - mantiene backward compatibility */ export declare function useLoggerClear(): void; /** * Wrapper para LoggerService - mantiene backward compatibility */ export declare function useLoggerTable(data: unknown): void; //# sourceMappingURL=logger.service.d.ts.map