Skip to content

Commit

Permalink
doc: improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
samber committed Dec 25, 2023
1 parent 7f6b3ed commit 0c7ed0f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ e.Use(slogecho.NewWithConfig(logger, config))
e.Use(middleware.Recover())
```

### Custom log levels

```go
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))

config := slogecho.Config{
DefaultLevel: slog.LevelInfo,
ClientErrorLevel: slog.LevelWarn,
ServerErrorLevel: slog.LevelError,
}

e := echo.New()
e.Use(slogecho.NewWithConfig(logger, config))
e.Use(middleware.Recover())
```

### Verbose

```go
Expand Down

0 comments on commit 0c7ed0f

Please sign in to comment.