Improve client logging.
Some checks failed
Linting and tests / Linting (push) Failing after 4s
Linting and tests / Tests (push) Failing after 3s

This commit is contained in:
2025-09-10 20:04:19 +05:00
parent e3b9c9ae40
commit c2142cc1a6
15 changed files with 118 additions and 44 deletions

View File

@@ -21,6 +21,7 @@ type database struct {
options core.Options
app *application.Application
db *sqlx.DB
logger *slog.Logger
migrations map[string]fs.FS
dbPath string
version int64
@@ -51,7 +52,7 @@ func (d *database) Configure() error {
d.db = db
slog.Info("Database opened.", "path", d.dbPath)
d.logger.Info("Database opened.", "path", d.dbPath)
if err := d.initializeSysInfoHandler(); err != nil {
return fmt.Errorf("configure: %w", err)
@@ -93,6 +94,10 @@ func (d *database) ConnectDependencies() error {
}
func (d *database) Initialize() error {
d.logger = d.app.NewLogger("service", core.ServiceNameDatabase)
d.logger.Info("Initializing...")
d.migrations = make(map[string]fs.FS, 0)
return nil