web 服务框架
This commit is contained in:
22
init/logs/logs.go
Normal file
22
init/logs/logs.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"platform/init/env"
|
||||
"time"
|
||||
|
||||
"github.com/lmittmann/tint"
|
||||
)
|
||||
|
||||
var Default *slog.Logger
|
||||
|
||||
func Init() {
|
||||
Default = slog.New(
|
||||
tint.NewHandler(os.Stdout, &tint.Options{
|
||||
Level: env.LogLevel,
|
||||
TimeFormat: time.Kitchen,
|
||||
}),
|
||||
)
|
||||
slog.SetDefault(Default)
|
||||
}
|
||||
Reference in New Issue
Block a user