OSDN Git Service

log writer close
authorwyjDoraemon <wyjDoraemon@163.com>
Thu, 15 Aug 2019 04:10:06 +0000 (12:10 +0800)
committerwyjDoraemon <wyjDoraemon@163.com>
Thu, 15 Aug 2019 04:10:06 +0000 (12:10 +0800)
log/log.go
p2p/security/security.go

index 398157e..60bfaf5 100644 (file)
@@ -68,8 +68,11 @@ 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 {
index 149148c..41db475 100644 (file)
@@ -6,7 +6,7 @@ import (
        cfg "github.com/bytom/config"
 )
 
-const logModule = "p2p/security"
+const logModule = "p2pSecurity"
 
 type Security struct {
        filter        *PeerFilter