Skip to content

Commit

Permalink
(rs#470) Update README for Stacktrace Logging
Browse files Browse the repository at this point in the history
Signed-off-by: Bhargav Ravuri <vaguecoder0to.n@gmail.com>
  • Loading branch information
vaguecoder committed Sep 12, 2022
1 parent ae0407d commit e6f2e5c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -232,17 +232,15 @@ func main() {
#### Error Logging with Stacktrace

Using `github.com/pkg/errors`, you can add a formatted stacktrace to your errors.
Using `github.com/rs/zerolog/pkgerrors` (formerly, `github.com/pkg/errors`), you can add a formatted stacktrace to your errors.

```go
package main

import (
"github.com/pkg/errors"
"github.com/rs/zerolog/pkgerrors"

"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/rs/zerolog/pkgerrors"
)

func main() {
Expand All @@ -254,7 +252,7 @@ func main() {
}

func inner() error {
return errors.New("seems we have an error here")
return pkgerrors.New("seems we have an error here")
}

func middle() error {
Expand Down

0 comments on commit e6f2e5c

Please sign in to comment.