Integrate logging channel system

update logging to use logger channel

updates
This commit is contained in:
Aaron Po
2026-05-15 01:13:53 -04:00
parent 29972f54d1
commit 54a46458a3
35 changed files with 586 additions and 440 deletions

View File

@@ -3,11 +3,11 @@
* @brief BiergartenDataGenerator::Run() implementation.
*/
#include <spdlog/spdlog.h>
#include "services/logging/logger.h"
#include <utility>
#include "biergarten_data_generator.h"
#include "biergarten_pipeline_orchestrator.h"
bool BiergartenPipelineOrchestrator::Run() {
try {
@@ -21,24 +21,27 @@ bool BiergartenPipelineOrchestrator::Run() {
for (auto& city : cities) {
try {
std::string region_context = context_service_->GetLocationContext(city);
// spdlog::debug("[Pipeline] Context for '{}' ({}) gathered:\n{}",
// city.city, city.iso3166_2, region_context);
// logger_->Log(LogLevel::Debug, PipelinePhase::UserGeneration,
// "[Pipeline] Context for '" + city.city + "' (" +
// city.iso3166_2 + ") gathered:\n" + region_context);
enriched.push_back(
EnrichedCity{.location = std::move(city),
.region_context = std::move(region_context)});
} catch (const std::exception& exception) {
++skipped_count;
spdlog::warn(
"[Pipeline] Skipping city '{}' ({}): context lookup failed: {}",
city.city, city.country, exception.what());
logger_->Log(LogLevel::Warn, PipelinePhase::UserGeneration,
std::string("[Pipeline] Skipping city '") + city.city +
" (" + city.country + "): context lookup failed: " +
exception.what());
}
}
if (skipped_count > 0) {
spdlog::warn(
"[Pipeline] Skipped {} city/cities due to context lookup errors",
skipped_count);
logger_->Log(LogLevel::Warn, PipelinePhase::UserGeneration,
std::string("[Pipeline] Skipped ") +
std::to_string(skipped_count) +
" city/cities due to context lookup errors");
}
this->GenerateBreweries(enriched);
@@ -46,7 +49,9 @@ bool BiergartenPipelineOrchestrator::Run() {
this->LogResults();
return true;
} catch (const std::exception& e) {
spdlog::error("Pipeline execution failed with error: {}", e.what());
logger_->Log(LogLevel::Error, PipelinePhase::Teardown,
std::string("Pipeline execution failed with error: ") +
e.what());
return false;
}
}