func addHooks(preparerConfig *PreparerConfig, logger logging.Logger) { for _, dest := range preparerConfig.ExtraLogDestinations { logger.WithFields(logrus.Fields{ "type": dest.Type, "path": dest.Path, }).Infoln("Adding log destination") logger.AddHook(dest.Type, dest.Path) } }
func addHooks(preparerConfig *PreparerConfig, logger logging.Logger) { for _, dest := range preparerConfig.ExtraLogDestinations { logger.WithFields(logrus.Fields{ "type": dest.Type, "path": dest.Path, }).Infoln("Adding log destination") if err := logger.AddHook(dest.Type, dest.Path); err != nil { logger.WithError(err).Errorf("Unable to add log hook. Proceeding.") } } }