|
|
@ -17,6 +17,11 @@ import (
|
|
|
|
"github.com/penggy/service"
|
|
|
|
"github.com/penggy/service"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
|
|
gitCommitCode string
|
|
|
|
|
|
|
|
buildDateTime string
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type program struct {
|
|
|
|
type program struct {
|
|
|
|
httpPort int
|
|
|
|
httpPort int
|
|
|
|
httpServer *http.Server
|
|
|
|
httpServer *http.Server
|
|
|
@ -128,13 +133,20 @@ func main() {
|
|
|
|
flag.StringVar(&utils.FlagVarConfFile, "config", "", "configure file path")
|
|
|
|
flag.StringVar(&utils.FlagVarConfFile, "config", "", "configure file path")
|
|
|
|
flag.Parse()
|
|
|
|
flag.Parse()
|
|
|
|
tail := flag.Args()
|
|
|
|
tail := flag.Args()
|
|
|
|
|
|
|
|
|
|
|
|
// log
|
|
|
|
// log
|
|
|
|
log.SetPrefix("[EasyDarwin] ")
|
|
|
|
log.SetPrefix("[EasyDarwin] ")
|
|
|
|
log.SetFlags(log.Lshortfile | log.LstdFlags)
|
|
|
|
log.SetFlags(log.Lshortfile | log.LstdFlags)
|
|
|
|
if !utils.Debug {
|
|
|
|
if !utils.Debug {
|
|
|
|
log.Println("log files -->", utils.LogDir())
|
|
|
|
log.Println("log files -->", utils.LogDir())
|
|
|
|
|
|
|
|
log.Printf("git commit code:%s", gitCommitCode)
|
|
|
|
|
|
|
|
log.Printf("build date:%s", buildDateTime)
|
|
|
|
log.SetOutput(utils.GetLogWriter())
|
|
|
|
log.SetOutput(utils.GetLogWriter())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Printf("git commit code:%s", gitCommitCode)
|
|
|
|
|
|
|
|
log.Printf("build date:%s", buildDateTime)
|
|
|
|
|
|
|
|
routers.BuildVersion = fmt.Sprintf("%s.%s", routers.BuildVersion, gitCommitCode)
|
|
|
|
|
|
|
|
routers.BuildDateTime = buildDateTime
|
|
|
|
|
|
|
|
|
|
|
|
sec := utils.Conf().Section("service")
|
|
|
|
sec := utils.Conf().Section("service")
|
|
|
|
svcConfig := &service.Config{
|
|
|
|
svcConfig := &service.Config{
|
|
|
|