aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/database.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-25 15:37:41 +0100
committerGitHub <noreply@github.com>2021-01-25 15:37:41 +0100
commit2a6cf69cffb83d0fbd73c4a0aabbb94df47b06c8 (patch)
tree146d9993a7d29cb0d1f35779ac31fc770895e393 /server/initializers/database.ts
parentab398a05e9ffaacb8fc713bb2ba9717ac463b34c (diff)
downloadPeerTube-2a6cf69cffb83d0fbd73c4a0aabbb94df47b06c8.tar.gz
PeerTube-2a6cf69cffb83d0fbd73c4a0aabbb94df47b06c8.tar.zst
PeerTube-2a6cf69cffb83d0fbd73c4a0aabbb94df47b06c8.zip
prettify SQL queries during debug (#3635)
* prettify SQL queries during debug * Use sql-formatter Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r--server/initializers/database.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index 128ed5b75..61768234f 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -69,12 +69,12 @@ const sequelizeTypescript = new SequelizeTypescript({
69 logging: (message: string, benchmark: number) => { 69 logging: (message: string, benchmark: number) => {
70 if (process.env.NODE_DB_LOG === 'false') return 70 if (process.env.NODE_DB_LOG === 'false') return
71 71
72 let newMessage = message 72 let newMessage = 'Executed SQL request'
73 if (isTestInstance() === true && benchmark !== undefined) { 73 if (isTestInstance() === true && benchmark !== undefined) {
74 newMessage += ' | ' + benchmark + 'ms' 74 newMessage += ' in ' + benchmark + 'ms'
75 } 75 }
76 76
77 logger.debug(newMessage) 77 logger.debug(newMessage, { sql: message })
78 } 78 }
79}) 79})
80 80