|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type AppEngine struct {
|
|
|
|
type AppEngine struct {
|
|
|
@ -68,6 +69,11 @@ func (ae *AppEngine) Setup(logger logrus.FieldLogger) *gin.Engine {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (ae *AppEngine) Start() error {
|
|
|
|
func (ae *AppEngine) Start() error {
|
|
|
|
|
|
|
|
//set the gin mode
|
|
|
|
|
|
|
|
gin.SetMode("release")
|
|
|
|
|
|
|
|
if strings.ToLower(ae.Config.GetString("log.level")) == "debug" {
|
|
|
|
|
|
|
|
gin.SetMode("debug")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
logger := logrus.New()
|
|
|
|
logger := logrus.New()
|
|
|
|
//set default log level
|
|
|
|
//set default log level
|
|
|
|