You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Database.logger is get-only, but I'd like to modify the Logger metadata and the log handler. My use-case is to track when Database.transaction is called, so I can warn when the original Database is being used before the transaction closure has been run. This is a common footgun in Vapor:
_ = try await req.db.transaction { transactionDB in
// run a query using transactionDB
// run a query using req.db
// run a query using transactionDB
}
Describe the solution you'd like
Make it settable. Application.loggeris settable. Request.loggeris too. So it seems viable to do this.
Additional context
If the maintainers are interested in this change, I can submit a PR.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Database.logger
is get-only, but I'd like to modify theLogger
metadata and the log handler. My use-case is to track whenDatabase.transaction
is called, so I can warn when the originalDatabase
is being used before the transaction closure has been run. This is a common footgun in Vapor:Describe the solution you'd like
Make it settable.
Application.logger
is settable.Request.logger
is too. So it seems viable to do this.Additional context
If the maintainers are interested in this change, I can submit a PR.
The text was updated successfully, but these errors were encountered: