feat: add log.FilePath() function for logger (#7080)

This commit is contained in:
DmitriyLewen
2024-07-02 15:48:20 +06:00
committed by GitHub
parent db68d106ce
commit 1f5f348958
24 changed files with 38 additions and 33 deletions

View File

@@ -157,12 +157,12 @@ func initConfig(configFile string) error {
viper.SetConfigType("yaml")
if err := viper.ReadInConfig(); err != nil {
if errors.Is(err, os.ErrNotExist) {
log.Debug("Config file not found", log.String("file_path", configFile))
log.Debug("Config file not found", log.FilePath(configFile))
return nil
}
return xerrors.Errorf("config file %q loading error: %s", configFile, err)
}
log.Info("Loaded", log.String("file_path", configFile))
log.Info("Loaded", log.FilePath(configFile))
return nil
}