Skip to content

Commit

Permalink
Fix sql formatter crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Oct 31, 2024
1 parent a91bd80 commit 29cdeb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/tests/src/api/server/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ describe('Test logs', function () {
})
})

describe('With some log options', function () {

it('Should not crash when enabling `prettify_sql` config', async function () {
await server.kill()
await server.run({ log: { prettify_sql: true } })
})
})

after(async function () {
await cleanupTests([ server ])
})
Expand Down
2 changes: 1 addition & 1 deletion server/core/helpers/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const consoleLoggerFormat = format.printf(info => {
if (info.sql) {
if (CONFIG.LOG.PRETTIFY_SQL) {
additionalInfos += '\n' + sqlFormat(info.sql, {
language: 'sql',
language: 'postgresql',
tabWidth: 2
})
} else {
Expand Down

0 comments on commit 29cdeb0

Please sign in to comment.