mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
refactor: use zap as logger ⚡
This commit is contained in:
parent
2831208de3
commit
f305701b30
34 changed files with 327 additions and 175 deletions
51
main.go
51
main.go
|
@ -1,36 +1,39 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/0xJacky/Nginx-UI/server"
|
||||
"github.com/0xJacky/Nginx-UI/server/service"
|
||||
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jpillora/overseer"
|
||||
"github.com/jpillora/overseer/fetcher"
|
||||
"log"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/0xJacky/Nginx-UI/logger"
|
||||
"github.com/0xJacky/Nginx-UI/server"
|
||||
"github.com/0xJacky/Nginx-UI/server/service"
|
||||
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jpillora/overseer"
|
||||
"github.com/jpillora/overseer/fetcher"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var confPath string
|
||||
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
||||
flag.Parse()
|
||||
var confPath string
|
||||
flag.StringVar(&confPath, "config", "app.ini", "Specify the configuration file")
|
||||
flag.Parse()
|
||||
|
||||
settings.Init(confPath)
|
||||
settings.Init(confPath)
|
||||
|
||||
gin.SetMode(settings.ServerSettings.RunMode)
|
||||
gin.SetMode(settings.ServerSettings.RunMode)
|
||||
|
||||
r, err := service.GetRuntimeInfo()
|
||||
r, err := service.GetRuntimeInfo()
|
||||
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
overseer.Run(overseer.Config{
|
||||
Program: server.Program,
|
||||
Address: fmt.Sprintf(":%s", settings.ServerSettings.HttpPort),
|
||||
Fetcher: &fetcher.File{Path: r.ExPath},
|
||||
TerminateTimeout: 0,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
overseer.Run(overseer.Config{
|
||||
Program: server.Program,
|
||||
Address: fmt.Sprintf(":%s", settings.ServerSettings.HttpPort),
|
||||
Fetcher: &fetcher.File{Path: r.ExPath},
|
||||
TerminateTimeout: 0,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue