Files
valitovgaziz 15357fd3c0 create and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarbacreate and moove into new directories for BegushiyBashkir and
yalarba
2025-10-24 05:22:44 +05:00

35 lines
935 B
Go

// pkg/logger/helpers.go
package logger
import (
"time"
"go.uber.org/zap"
)
// LogApplicationStart логирует запуск приложения
func LogApplicationStart(version, environment, port string) {
Get().Info("application starting",
zap.String("version", version),
zap.String("environment", environment),
zap.String("port", port),
zap.Time("start_time", time.Now()),
)
}
// LogApplicationShutdown логирует graceful shutdown
func LogApplicationShutdown(reason string) {
Get().Info("application shutting down",
zap.String("reason", reason),
zap.Time("shutdown_time", time.Now()),
)
}
// LogDatabaseStats логирует статистику базы данных
func LogDatabaseStats(stats map[string]interface{}) {
fields := make([]zap.Field, 0, len(stats))
for key, value := range stats {
fields = append(fields, zap.Any(key, value))
}
Get().Info("database statistics", fields...)
}