feat: replace log with rs/zerolog for structured logging

Switch from the standard library log package to rs/zerolog with
ConsoleWriter for colorful terminal output in dev mode and JSON
output in production. Users can now provide their own logger via
Options.Logger or set the level via Options.LogLevel.
This commit is contained in:
Ryan Hamamura
2026-01-31 08:18:24 -10:00
parent d8318af9c4
commit a7ace9099f
10 changed files with 75 additions and 52 deletions

View File

@@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"fmt"
"log"
"maps"
"reflect"
"sync"
@@ -456,7 +455,7 @@ func (c *Context) unsubscribeAll() {
func newContext(id string, route string, v *V) *Context {
if v == nil {
log.Fatal("create context failed: app pointer is nil")
panic("create context failed: app pointer is nil")
}
return &Context{