typeorm
Version:
Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.
47 lines (46 loc) • 1.76 kB
TypeScript
import { LoggerOptions, FileLoggerOptions } from "./LoggerOptions";
import { QueryRunner } from "../query-runner/QueryRunner";
import { Logger } from "./Logger";
/**
* Performs logging of the events in TypeORM.
* This version of logger logs everything into ormlogs.log file.
*/
export declare class FileLogger implements Logger {
private options?;
private fileLoggerOptions?;
constructor(options?: LoggerOptions | undefined, fileLoggerOptions?: FileLoggerOptions | undefined);
/**
* Logs query and parameters used in it.
*/
logQuery(query: string, parameters?: any[], queryRunner?: QueryRunner): void;
/**
* Logs query that is failed.
*/
logQueryError(error: string, query: string, parameters?: any[], queryRunner?: QueryRunner): void;
/**
* Logs query that is slow.
*/
logQuerySlow(time: number, query: string, parameters?: any[], queryRunner?: QueryRunner): void;
/**
* Logs events from the schema build process.
*/
logSchemaBuild(message: string, queryRunner?: QueryRunner): void;
/**
* Logs events from the migrations run process.
*/
logMigration(message: string, queryRunner?: QueryRunner): void;
/**
* Perform logging using given logger, or by default to the console.
* Log has its own level and message.
*/
log(level: "log" | "info" | "warn", message: any, queryRunner?: QueryRunner): void;
/**
* Writes given strings into the log file.
*/
protected write(strings: string | string[]): void;
/**
* Converts parameters to a string.
* Sometimes parameters can have circular objects and therefor we are handle this case too.
*/
protected stringifyParams(parameters: any[]): string | any[];
}