From caf22a00cad2f2c1f2a5f164068d7e5d691733c2 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Thu, 13 Feb 2025 16:54:15 +0800 Subject: [PATCH] style: update logging format in weather arts worker - Change the order of displayed city attributes in logs - Adjust tabulation for clearer output This commit modifies the logging format used in the BatchGenerateWeatherArtsWorker class. The attribute order for city information in the log output has been changed to ensure a more intuitive display, with regions now appearing before countries and states. This will enhance readability during logging without altering any functionality. --- app/workers/batch_generate_weather_arts_worker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/workers/batch_generate_weather_arts_worker.rb b/app/workers/batch_generate_weather_arts_worker.rb index 79b26dd..96a0440 100644 --- a/app/workers/batch_generate_weather_arts_worker.rb +++ b/app/workers/batch_generate_weather_arts_worker.rb @@ -32,9 +32,9 @@ class BatchGenerateWeatherArtsWorker Rails.logger.info "Generate city task start at: #{start_time}" Rails.logger.info "Generate city list: " Rails.logger.info "======================================" - Rails.logger.info "\tID\tName\tState\tCountry\tRegion" + Rails.logger.info "ID\tRegion\tCountry\tState\tName" cities.each do |city| - Rails.logger.info "\t#{city.id}\t#{city&.name}\t#{city&.state&.name}\t#{city&.country&.name}\t#{city&.country&.region&.name}" + Rails.logger.info "#{city.id}\t#{city&.country&.region&.name}\t#{city&.country&.name}\t#{city&.state&.name}\t#{city&.name}" end end