mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
refactor(logger): more consistent error output
This commit is contained in:
1 parent
77251b3739
commit
e07947d3b9
4 files changed
+39
-28
No files matched your search
+14
-1
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user