We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm always doing the same thing. Make this easier out-of-the-box:
def sources: ConfigSources[IO] = // Highest pri ConfigSource.environment[IO].expandInlineProperties("APP_PROPS").mapKeyQueries(acceptExternalKeyFormat) > ConfigSource.propFileOnClasspath[IO]("app.properties", optional = true) > ConfigSource.system[IO] // Lowest pri private def acceptExternalKeyFormat(k: ConfigKey): List[ConfigKey] = k :: k.map(_.toUpperCase.replace('.', '_')) :: Nil def load: IO[Option[AppConfig]] = config .withReport .run(sources) .map { result => result.toEither match { case Right((config, report)) => if (config.showUnusedConfig) logger.info("Config report\n" + report.full) else logger.info("Config report\n" + report.sources + "\n\n" + report.used) Some(config) case Left(err) => logger.error("Invalid config:\n" + err) None } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm always doing the same thing. Make this easier out-of-the-box:
The text was updated successfully, but these errors were encountered: