]> 127.0.0.1 Git - part/.git/commitdiff
60
authorqydysky <qydysky@foxmail.com>
Mon, 14 Sep 2020 22:51:11 +0000 (06:51 +0800)
committerqydysky <qydysky@foxmail.com>
Mon, 14 Sep 2020 22:51:11 +0000 (06:51 +0800)
Log.go

diff --git a/Log.go b/Log.go
index b38f4c4f530697a215c72f8f4a7a2c646edf2169..35f562d1c872e3a3b33a5b2ad505cf8dbb7dca00 100644 (file)
--- a/Log.go
+++ b/Log.go
@@ -105,6 +105,11 @@ func (I *logl) New() (O *logl) {
 
 func (O *logl) logf(file *os.File) (int) {
     var tmp int
+    var showObj []io.Writer
+
+    if file != nil {showObj = append(showObj, file)}
+    if file == nil || !O.fileonly {showObj = append(showObj, os.Stdout)}
+
     for len(O.channelN) != 0 {
         channelN := <- O.channelN
 
@@ -117,10 +122,6 @@ func (O *logl) logf(file *os.File) (int) {
         
         if channelN >= 0 && channelN < O.level {continue}
 
-        var showObj []io.Writer
-        if file != nil {showObj = append(showObj, file)}
-        if file == nil || !O.fileonly {showObj = append(showObj, os.Stdout)}
-        
         switch channelN {
         case blockErr:
             tmp = channelN