mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-27 07:58:30 +03:00
[PR #2954] [MERGED] Add dev-only query logging support #3166
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/2954
Author: @BlackDex
Created: 12/3/2022
Status: ✅ Merged
Merged: 12/5/2022
Merged by: @dani-garcia
Base:
main← Head:sql-debugging📝 Commits (1)
1b64b9eAdd dev-only query logging support📊 Changes
5 files changed (+46 additions, -8 deletions)
View changed files
📝
Cargo.lock(+11 -0)📝
Cargo.toml(+6 -0)📝
build.rs(+13 -8)📝
src/db/mod.rs(+8 -0)📝
src/main.rs(+8 -0)📄 Description
This PR adds query logging support as an optional feature. It is only allowed during development/debug builds, and will abort when used during a
--releasebuild.For this feature to be fully activated you also need to se an environment variable
QUERY_LOGGER=1to activate the debug log-level for this crate, else there will be no output.The reason for this PR is that sometimes it is useful to be able to see the generated queries, like when debugging an issue, or trying to optimize a query. Currently i always added this code when needed, but having this a part of the code could benifit other developers too who maybe need this.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.