UNPKG

@nowarajs/logger

Version:

Type-safe logging library for Bun with advanced TypeScript body intersection, modular strategy pattern, transform streams, and immutable API design.

26 lines (25 loc) 889 B
import type { LoggerStrategy } from '../types/loggerStrategy'; import type { LogLevels } from '../types/logLevels'; /** * FileLoggerStrategy implements LoggerStrategy to provide logging functionality to the file system. ({@link LoggerStrategy}) */ export declare class FileLoggerStrategy implements LoggerStrategy { /** * Path to the file to log to. */ private readonly _path; /** * Constructor FileLoggerStrategy * * @param path - Path to the file to log to. */ constructor(path: string); /** * Logs a message to the file system with the specified log level. * * @param level - The log level at which the message should be logged. {@link LogLevels} * @param date - The date at which the message was logged. * @param object - The object to log. */ log(level: LogLevels, date: Date, object: unknown): Promise<void>; }