feat: set dev-mode into config
This commit is contained in:
@ -75,7 +75,7 @@ func initConfig() {
|
||||
func logOptions() *log.Options {
|
||||
return &log.Options{
|
||||
Level: viper.GetString("log.level"),
|
||||
Development: viper.GetBool("log.development"),
|
||||
Development: viper.GetBool("dev-mode"),
|
||||
DisableCaller: viper.GetBool("log.disable-caller"),
|
||||
DisableStacktrace: viper.GetBool("log.disable-stacktrace"),
|
||||
Format: viper.GetString("log.format"),
|
||||
|
@ -102,6 +102,13 @@ func run() error {
|
||||
log.InfoLog(string(settings))
|
||||
log.InfoLog(viper.GetString("db.username"))
|
||||
|
||||
isDev := viper.GetBool("dev-mode")
|
||||
if isDev {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
} else {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
r.GET("/", func(ctx *gin.Context) {
|
||||
|
Reference in New Issue
Block a user