@mikro-orm/core
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
37 lines (36 loc) • 1.36 kB
TypeScript
import type { Logger, LoggerNamespace, LogContext, LoggerOptions } from './Logger.js';
/** Default logger implementation with colored output, query formatting, and namespace-based filtering. */
export declare class DefaultLogger implements Logger {
private readonly options;
debugMode: boolean | LoggerNamespace[];
readonly writer: (message: string) => void;
private readonly usesReplicas?;
private readonly highlighter?;
constructor(options: LoggerOptions);
/**
* @inheritDoc
*/
log(namespace: LoggerNamespace, message: string, context?: LogContext): void;
/**
* @inheritDoc
*/
error(namespace: LoggerNamespace, message: string, context?: LogContext): void;
/**
* @inheritDoc
*/
warn(namespace: LoggerNamespace, message: string, context?: LogContext): void;
/**
* @inheritDoc
*/
setDebugMode(debugMode: boolean | LoggerNamespace[]): void;
/** Checks whether logging is enabled for the given namespace, considering context overrides. */
isEnabled(namespace: LoggerNamespace, context?: LogContext): boolean;
/**
* @inheritDoc
*/
logQuery(context: {
query: string;
} & LogContext): void;
/** Factory method for creating a new DefaultLogger instance. */
static create(this: void, options: LoggerOptions): DefaultLogger;
}