/** * Logs query that is failed. */ logQueryError(error: string, query: string, parameters?: any[], queryRunner?: QueryRunner) { if (this.options === 'all' || this.options === true || (this.options instanceof Array && this.options.indexOf('error') !== -1)) { const sql = query + (parameters && parameters.length ? ' -- PARAMETERS: ' + this.stringifyParams(parameters) : ''); Log.log.error(chalk.default.underline.red(`query failed: `) + PlatformTools.highlightSql(sql)); Log.log.error(chalk.default.underline.red(`error: `) + error); } }
/** * Logs events from the schema build process. */ logSchemaBuild(message: string, queryRunner?: QueryRunner) { if (this.options === 'all' || (this.options instanceof Array && this.options.indexOf('schema') !== -1)) { Log.log.debug(chalk.default.underline(message)); } }
/** * Logs query and parameters used in it. */ logQuery(query: string, parameters?: any[], queryRunner?: QueryRunner) { if (this.options === 'all' || this.options === true || (this.options instanceof Array && this.options.indexOf('query') !== -1)) { const sql = query + (parameters && parameters.length ? ' -- PARAMETERS: ' + this.stringifyParams(parameters) : ''); Log.log.verbose(chalk.default.gray.underline('executing query: ') + PlatformTools.highlightSql(sql)); } }