From b12c7b5f50749a73b4599c1c15d8e242deb64e8e Mon Sep 17 00:00:00 2001 From: wz Date: Tue, 13 Aug 2019 15:42:59 +0800 Subject: [PATCH] fix log (#388) --- README.md | 2 +- log/log.go | 9 ++++++--- p2p/security/security.go | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e8e838eb..55fd2821 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ cast in consensus around, and choose how many rounds of consensus to allocate th ### Merger utxo UTXO has been merged to solve the problem that too much UTXO input causes a failed send transaction to fail. -[details](./toolbar/merger_utxo/README.md) +[details](./cmd/utxomerge/README.md) ## License diff --git a/log/log.go b/log/log.go index c7664834..818e5ef3 100644 --- a/log/log.go +++ b/log/log.go @@ -68,15 +68,18 @@ func (hook *BtmHook) ioWrite(entry *logrus.Entry) error { return err } - _, err = writer.Write(msg) - return err + if _, err = writer.Write(msg); err != nil { + return err + } + + return writer.Close() } func clearLockFiles(logPath string) error { files, err := ioutil.ReadDir(logPath) if os.IsNotExist(err) { return nil - }else if err != nil { + } else if err != nil { return err } diff --git a/p2p/security/security.go b/p2p/security/security.go index 7c9e9454..47d5128e 100644 --- a/p2p/security/security.go +++ b/p2p/security/security.go @@ -6,7 +6,7 @@ import ( cfg "github.com/vapor/config" ) -const logModule = "p2p/security" +const logModule = "p2pSecurity" type Security struct { filter *PeerFilter -- 2.11.0