Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
README to customize logs
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamjenson committed Aug 21, 2023
1 parent 5c645d7 commit 3d85b97
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions logger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Socket.io Logging

Override internal logger with:

```go
import (
...
"github.com/googollee/go-socket.io/logger"
)


func main() {
json_logger := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
Level: slog.LevelInfo, // Set Level for each handler
})

log := slog.New(json_logger).With("server", "socket.io") // attach attribute to all log lines
logger.Log = log
}
```

0 comments on commit 3d85b97

Please sign in to comment.