---
panlei
2019-12-09 7a10088075f5d9a51ec92c8692bf46895aa3e9c3
main.go
@@ -3,13 +3,16 @@
import (
   "flag"
   "fmt"
   "github.com/spf13/viper"
   "sync"
   "net/http"
   _ "net/http/pprof"
   "plugin"
   //"github.com/spf13/viper"
   logger "github.com/alecthomas/log4go"
   //"basic.com/valib/logger.git"
   "basic.com/valib/logger.git"
   "github.com/panjf2000/ants/v2"
   "basic.com/pubsub/protomsg.git"
@@ -33,16 +36,16 @@
   // 日志初始化
   insertdata.Init(*env)
   //var logFile = "./logger/"
   //if viper.GetString("LogBasePath") != "" {
   //   logFile = viper.GetString("LogBasePath")
   //}
   var logFile = "./logger/"
   if viper.GetString("LogBasePath") != "" {
      logFile = viper.GetString("LogBasePath")
   }
   //logFile = logFile + "ruleprocess.log"
   //fmt.Println("日志地址:",logFile)
   //logger.Config(logFile, logger.DebugLevel)
   //logger.SetSaveDays(7)
   logger.Config(logFile, logger.DebugLevel)
   logger.SetSaveDays(7)
   // log4go
   logger.LoadConfiguration("./logger/log.xml")
   //logger.LoadConfiguration("./logger/log.xml")
   logger.Info("日志初始化成功!")
}
@@ -89,6 +92,8 @@
         wg1.Add(1)
         _ = p.Submit(syncCalculateSum)
         //go Task(msg)
      } else {
         fmt.Println("接收数据失败",err)
      }
   }
}