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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user