chore: Move config definition to cpp file (#2371)

Having such a long init list in almost every translation unit is
definitely not nice.
It makes it more difficult to work on custom logger (because I need to
adjust log_format), so let's move it to cpp file
This commit is contained in:
Ayaz Salikhov
2025-07-29 11:52:41 +01:00
committed by GitHub
parent d048641242
commit 9e35f16be1
6 changed files with 172 additions and 154 deletions

View File

@@ -53,6 +53,7 @@ try {
if (not app::parseConfig(run.configPath))
return EXIT_FAILURE;
ClioConfigDefinition& gClioConfig = getClioConfig();
PrometheusService::init(gClioConfig);
if (auto const initSuccess = util::LogService::init(gClioConfig); not initSuccess) {
std::cerr << initSuccess.error() << std::endl;
@@ -65,11 +66,11 @@ try {
if (not app::parseConfig(migrate.configPath))
return EXIT_FAILURE;
if (auto const initSuccess = util::LogService::init(gClioConfig); not initSuccess) {
if (auto const initSuccess = util::LogService::init(getClioConfig()); not initSuccess) {
std::cerr << initSuccess.error() << std::endl;
return EXIT_FAILURE;
}
app::MigratorApplication migrator{gClioConfig, migrate.subCmd};
app::MigratorApplication migrator{getClioConfig(), migrate.subCmd};
return migrator.run();
}
);