a8m / a8m/kinesis-producer

Logrus Entry vs Logger

オープン
#23 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
150
フォーク
47
PR マージ指標
30日以内にマージされた PR はありません

説明

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:
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。