KyselyLogger: also log errors

This commit is contained in:
Alex Gleason 2024-07-29 21:19:44 -05:00
parent c54d801dd0
commit ce18cb928a
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -4,7 +4,6 @@ import { dbQueryTimeHistogram } from '@/metrics.ts';
/** Log the SQL for queries. */
export const KyselyLogger: Logger = (event) => {
if (event.level === 'query') {
const console = new Stickynotes('ditto:sql');
const { query, queryDurationMillis } = event;
@ -17,5 +16,4 @@ export const KyselyLogger: Logger = (event) => {
JSON.stringify(parameters),
`\x1b[90m(${(queryDurationMillis / 1000).toFixed(2)}s)\x1b[0m`,
);
}
};