Skip to main content
Module

x/typeorm/src/index.ts>AdvancedConsoleLogger

Forked from https://github.com/typeorm/typeorm
Latest
class AdvancedConsoleLogger
implements Logger
import { AdvancedConsoleLogger } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/index.ts";

Performs logging of the events in TypeORM. This version of logger uses console to log events and use syntax highlighting.

Constructors

new
AdvancedConsoleLogger(options?: LoggerOptions)

Methods

protected
stringifyParams(parameters: any[])

Converts parameters to a string. Sometimes parameters can have circular objects and therefor we are handle this case too.

log(
level: "log" | "info" | "warn",
message: any,
queryRunner?: QueryRunner,
)

Perform logging using given logger, or by default to the console. Log has its own level and message.

logMigration(message: string, queryRunner?: QueryRunner)

Logs events from the migration run process.

logQuery(
query: string,
parameters?: any[],
queryRunner?: QueryRunner,
)

Logs query and parameters used in it.

logQueryError(
error: string,
query: string,
parameters?: any[],
queryRunner?: QueryRunner,
)

Logs query that is failed.

logQuerySlow(
time: number,
query: string,
parameters?: any[],
queryRunner?: QueryRunner,
)

Logs query that is slow.

logSchemaBuild(message: string, queryRunner?: QueryRunner)

Logs events from the schema build process.