Make database log a sublogger of Bridge, like all other modules. (#260)

This commit is contained in:
Alexandre Macabies
2021-01-25 20:01:54 +01:00
committed by GitHub
parent 500cb0cd7c
commit 95f6487912
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ type Database struct {
Message *MessageQuery
}
func New(dbType string, uri string) (*Database, error) {
func New(dbType string, uri string, baseLog log.Logger) (*Database, error) {
conn, err := sql.Open(dbType, uri)
if err != nil {
return nil, err
@ -50,7 +50,7 @@ func New(dbType string, uri string) (*Database, error) {
db := &Database{
DB: conn,
log: log.Sub("Database"),
log: baseLog.Sub("Database"),
dialect: dbType,
}
db.User = &UserQuery{