enhance: log level

This commit is contained in:
0xJacky 2023-05-06 22:43:25 +08:00
parent 59ca8d9eb8
commit af12612343
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
7 changed files with 54 additions and 36 deletions

53
main.go
View file

@ -1,39 +1,40 @@
package main
import (
"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"
"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"
)
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)
logger.Init(settings.ServerSettings.RunMode)
r, err := service.GetRuntimeInfo()
gin.SetMode(settings.ServerSettings.RunMode)
defer logger.Sync()
defer logger.Sync()
if err != nil {
log.Fatalln(err)
}
r, err := service.GetRuntimeInfo()
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 {
logger.Fatal(err)
}
overseer.Run(overseer.Config{
Program: server.Program,
Address: fmt.Sprintf(":%s", settings.ServerSettings.HttpPort),
Fetcher: &fetcher.File{Path: r.ExPath},
TerminateTimeout: 0,
})
}