mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
use slog
This commit is contained in:
10
router.go
10
router.go
@@ -3,6 +3,8 @@ package showbridge
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Router struct {
|
||||
@@ -12,6 +14,14 @@ type Router struct {
|
||||
|
||||
func NewRouter(ctx context.Context, config Config) (*Router, error) {
|
||||
|
||||
logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
|
||||
Level: slog.LevelDebug,
|
||||
}))
|
||||
|
||||
slog.SetDefault(logger)
|
||||
|
||||
slog.Debug("creating router", "config", config)
|
||||
|
||||
router := Router{
|
||||
Context: ctx,
|
||||
ModuleInstances: []Module{},
|
||||
|
||||
Reference in New Issue
Block a user