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

@@ -0,0 +1,20 @@
package application
import (
"log/slog"
"os"
)
func (a *Application) initializeLogger() {
a.baseLogger = slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
AddSource: true,
Level: slog.LevelDebug,
}))
a.appLogger = a.baseLogger.With("module", "application")
}
// NewLogger creates new sub-instance of base logger and adds some additional data to it for persistent output.
func (a *Application) NewLogger(withs ...interface{}) *slog.Logger {
return a.baseLogger.With(withs...)
}