fixing logrus example and case
This commit is contained in:
@ -11,7 +11,7 @@ This example assumes Ubuntu 16.04
|
|||||||
```sh
|
```sh
|
||||||
sudo apt-get install pkg-config libsodium-dev
|
sudo apt-get install pkg-config libsodium-dev
|
||||||
go get github.com/hkparker/go-i2p
|
go get github.com/hkparker/go-i2p
|
||||||
go get github.com/sirupsen/logrus
|
go get github.com/Sirupsen/logrus
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -32,12 +32,12 @@ The I2P community maintains up-to-date [specifications](https://geti2p.net/spec)
|
|||||||
Logrus is used for logging across all of go-i2p. All log statements should contain an `at` fields and a `reason` field. Here is a good example from the go-i2p implementation of a LeaseSet:
|
Logrus is used for logging across all of go-i2p. All log statements should contain an `at` fields and a `reason` field. Here is a good example from the go-i2p implementation of a LeaseSet:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
log.WithFields(log.Fields(
|
log.WithFields(log.Fields{
|
||||||
"at": "(LeaseSet) PublicKey",
|
"at": "(LeaseSet) PublicKey",
|
||||||
"data_len": remainer_len,
|
"data_len": remainer_len,
|
||||||
"required_len": LEASE_SET_PUBKEY_SIZE,
|
"required_len": LEASE_SET_PUBKEY_SIZE,
|
||||||
"reason": "not enough data",
|
"reason": "not enough data",
|
||||||
)).Error("error parsing public key")
|
}).Error("error parsing public key")
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Testing
|
#### Testing
|
||||||
|
@ -2,7 +2,7 @@ package crypto
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -3,7 +3,7 @@ package crypto
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"golang.org/x/crypto/openpgp/elgamal"
|
"golang.org/x/crypto/openpgp/elgamal"
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
|
Reference in New Issue
Block a user