CustomLoggerSQLDatabase does not override logger
t-ae opened this issue · 0 comments
t-ae commented
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.