Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomLoggerSQLDatabase does not override logger #159

Open
t-ae opened this issue Dec 9, 2022 · 0 comments
Open

CustomLoggerSQLDatabase does not override logger #159

t-ae opened this issue Dec 9, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@t-ae
Copy link

t-ae commented Dec 9, 2022

var logger = Logger(label: "My Logger")
logger.logLevel = .trace // to show label

let sqldb = app.db as! SQLDatabase
let logdb = sqldb.logging(to: logger)

try! logdb.raw("select 1;").run().wait()
// Expected: [ My Logger ] [ DEBUG ] select 1; [] [database-id: mysql]
// Actual  : [ codes.vapor.application ] [ DEBUG ] select 1; [] [database-id: mysql]

The type of logdb is CustomLoggerSQLDatabase.
Its execute method simply calls wrapped database's execute. logger is unused.

@t-ae t-ae added the bug Something isn't working label Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant