2023-04-13 00:07:08 +02:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
2023-05-03 02:18:29 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/app/settings"
|
2023-04-19 02:12:27 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/slogging"
|
2023-05-09 17:35:00 +02:00
|
|
|
"golang.org/x/exp/slog"
|
2023-04-13 00:07:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2023-05-11 04:32:39 +02:00
|
|
|
setting *settings.Settings
|
|
|
|
appver string
|
2023-05-11 17:06:20 +02:00
|
|
|
slogger *slogging.Slogger
|
|
|
|
log slogging.Slogger
|
2023-04-13 00:07:08 +02:00
|
|
|
)
|
|
|
|
|
2023-05-11 04:32:39 +02:00
|
|
|
func InitHandlers(s *settings.Settings) {
|
2023-05-11 17:06:20 +02:00
|
|
|
slogger = slogging.Logger()
|
2023-05-09 17:35:00 +02:00
|
|
|
log = *slogger // have a local copy.
|
|
|
|
log.Logger = log.Logger.With(
|
|
|
|
slog.Group("pcmt extra", slog.String("module", "handlers")),
|
|
|
|
)
|
2023-04-13 00:07:08 +02:00
|
|
|
|
2023-05-03 02:18:29 +02:00
|
|
|
setting = s
|
2023-04-13 00:07:08 +02:00
|
|
|
|
2023-05-03 02:18:29 +02:00
|
|
|
appver = setting.Version()
|
2023-04-13 00:07:08 +02:00
|
|
|
}
|