feat: add groups to loggers

This commit is contained in:
Guz
2025-03-12 10:06:06 -03:00
parent 4ee46e2dc8
commit c8285833d4

View File

@@ -116,7 +116,7 @@ func (app *app) setup() error {
SQL: app.db,
Context: app.ctx,
Assertions: app.assert,
Logger: app.logger,
Logger: app.logger.WithGroup("database"),
})
if err != nil {
return errors.Join(errors.New("unable to create database struct"), err)
@@ -129,7 +129,7 @@ func (app *app) setup() error {
Context: app.ctx,
Assertions: app.assert,
Logger: app.logger,
Logger: app.logger.WithGroup("service"),
})
if err != nil {
return errors.Join(errors.New("unable to initiate service"), err)
@@ -143,7 +143,7 @@ func (app *app) setup() error {
StaticFiles: app.staticFiles,
Assertions: app.assert,
Logger: app.logger,
Logger: app.logger.WithGroup("router"),
})
if err != nil {
return errors.Join(errors.New("unable to initiate router"), err)