Skip to content

Commit 59f493a

Browse files
committed
Debug
1 parent f7ece22 commit 59f493a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

pkg/config/init.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@ func InitViperConfig(configPath string) {
5858
viper.SetConfigFile(configPath)
5959
} else {
6060
// Use default behavior - search for config.yaml in common locations
61-
viper.SetConfigName("config") // name of config file (without extension)
62-
viper.SetConfigType("yaml") // REQUIRED if the config file does not have the extension in the name
63-
viper.AddConfigPath(".") // optionally look for config in the working directory
64-
viper.AddConfigPath("/etc/mpcium/") // look for config in /etc/mpcium/
61+
viper.SetConfigName("config") // name of config file (without extension)
62+
viper.SetConfigType("yaml") // REQUIRED if the config file does not have the extension in the name
63+
viper.AddConfigPath(".") // optionally look for config in the working directory
64+
viper.AddConfigPath("/etc/mpcium/") // look for config in /etc/mpcium/
6565
viper.AddConfigPath("$HOME/.mpcium/") // look for config in home directory
6666
}
67-
6867
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
6968
viper.AutomaticEnv()
7069
err := viper.ReadInConfig() // Find and read the config file
@@ -74,6 +73,8 @@ func InitViperConfig(configPath string) {
7473

7574
log.Println("Reading config file:", viper.ConfigFileUsed())
7675
log.Println("Initialized config successfully!")
76+
log.Println("Environment", viper.GetString("environment"))
77+
log.Println("consul.token", viper.GetString("consul.token"))
7778
}
7879

7980
func LoadConfig() *AppConfig {

0 commit comments

Comments
 (0)