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.
This commit is contained in:
songtianlun 2025-02-13 16:54:15 +08:00
parent 80d623b0c2
commit caf22a00ca

View File

@ -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