INNER CODE UNIT · Go

NewRegistry

psviderski/unregistry · registry.go:24

func NewRegistry(cfg Config) (*Registry, error) {
	// Configure logging.
	level, err := logrus.ParseLevel(cfg.LogLevel)
	if err != nil {
		return nil, fmt.Errorf("invalid log level: %w", err)
	}
	logrus.SetLevel(level)

	switch cfg.LogFormatter {
	case "json":
		logrus.SetFormatter(&logrus.JSONFormatter{})
	case "text":
		logrus.SetFormatter(&logrus.TextFormatter{})
	default:
		return nil, fmt.Errorf("invalid log formatter: '%s'; expected 'json' or 'text'", cfg.LogFormatter)
	}

	distConfig := &configuration.Configuration{

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…