refactor(logger): more consistent error output

This commit is contained in:
Linden committed 2023-07-20 16:10:51 +10:00
1 parent 77251b3739
commit e07947d3b9
4 files changed
+39 -28

No files matched your search

+14 -1
View File
@@ -1,8 +1,21 @@
import { PoolConnection, RowDataPacket } from 'mysql2/promise';
import { mysql_debug, mysql_slow_query_warning, mysql_ui } from '../config';
import type { CFXParameters } from '../types';
import type { CFXCallback, CFXParameters } from '../types';
import { dbVersion } from '../database';
export function printError(
invokingResource: string,
cb: CFXCallback | undefined,
isPromise: boolean | undefined,
...args: string[]
) {
const err = `${invokingResource} was unable to execute a query!\nQuery: ${args.join('\n')}`;
if (cb && isPromise) return cb(null, err);
console.error(err);
}
export const profilerStatements = [
'SET profiling_history_size = 0',
'SET profiling = 0',