24 lines
471 B
Go
24 lines
471 B
Go
package logging
|
|
|
|
import (
|
|
"log/slog"
|
|
"os"
|
|
)
|
|
|
|
func custom() {
|
|
//logger := log.New(os.Stderr, "INFO\t", log.LstdFlags|log.Lmicroseconds|log.Lshortfile)
|
|
}
|
|
|
|
// New check this later https://github.com/hedzr/logg
|
|
func New() {
|
|
handlerOpts := &slog.HandlerOptions{
|
|
Level: slog.LevelDebug,
|
|
//AddSource: true,
|
|
}
|
|
|
|
logger := slog.New(slog.NewJSONHandler(os.Stderr, handlerOpts))
|
|
//.WithAttrs([]slog.Attr{slog.String("app_version", "v0.0.1")})
|
|
|
|
slog.SetDefault(logger)
|
|
}
|