|
|
@ -1,6 +1,7 @@ |
|
|
|
package logger |
|
|
|
|
|
|
|
import ( |
|
|
|
"LAPP_GAAS_GFrame_BACKEND/utils" |
|
|
|
"errors" |
|
|
|
"github.com/spf13/viper" |
|
|
|
) |
|
|
@ -48,9 +49,13 @@ type outputSettings struct { |
|
|
|
|
|
|
|
func InitConfig() error { |
|
|
|
var err error |
|
|
|
baseDir, err := utils.GetCurrentPath("conf") |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
viper.SetConfigName("log_config") |
|
|
|
viper.SetConfigType("yaml") |
|
|
|
viper.AddConfigPath("./conf/") |
|
|
|
viper.AddConfigPath(baseDir) |
|
|
|
if err = viper.ReadInConfig(); err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|