a8m / a8m/kinesis-producer

Logrus Entry vs Logger

Đang mở
#23 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
150
Fork
47
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

To support logging already defined fields using logrus, is there any concern with switching to `Entry` rather than `Logger`?

From [logrus docs](https://github.com/sirupsen/logrus/blob/master/entry.go#L47):

```
These objects can be reused and passed around as much as you wish to avoid field duplication.
```

Add [README](https://github.com/sirupsen/logrus#default-fields)

```
Often it's helpful to have fields always attached to log statements in an application or parts of one. For example, you may want to always log the request_id and user_ip in the context of a request. Instead of writing log.WithFields(log.Fields{"request_id": request_id, "user_ip": user_ip}) on every line, you can create a logrus.Entry to pass around instead:
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.