Merge branch 'perf-log-params' into 'main'
SqliteWorker: log query parameters See merge request soapbox-pub/ditto!143
This commit is contained in:
commit
9024ec8655
|
@ -27,7 +27,12 @@ export const SqliteWorker = {
|
||||||
|
|
||||||
if (perf) {
|
if (perf) {
|
||||||
const { duration } = perf.measure('end', 'start');
|
const { duration } = perf.measure('end', 'start');
|
||||||
console.debug(`${sql} \x1b[90m(${(duration / 1000).toFixed(2)}s)\x1b[0m`);
|
|
||||||
|
console.debug(
|
||||||
|
sql.replace(/\s+/g, ' '),
|
||||||
|
JSON.stringify(parameters),
|
||||||
|
`\x1b[90m(${(duration / 1000).toFixed(2)}s)\x1b[0m`,
|
||||||
|
);
|
||||||
|
|
||||||
perf.clearMarks();
|
perf.clearMarks();
|
||||||
perf.clearMeasures();
|
perf.clearMeasures();
|
||||||
|
|
Loading…
Reference in New Issue