1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54:22 +00:00

Add some debug logging

This commit is contained in:
Steffo 2023-03-21 15:51:26 +01:00
parent 384d209b5c
commit 27911378dd
Signed by: steffo
GPG key ID: 2A24051445686895
2 changed files with 9 additions and 0 deletions

View file

@ -83,9 +83,13 @@ pub fn create_globalindexes_from_wd() -> globals::LocalizedGlobalsIndexes {
pub async fn create_globalindexes_from_dd_latest_en_us() -> globals::LocalizedGlobalsIndexes { pub async fn create_globalindexes_from_dd_latest_en_us() -> globals::LocalizedGlobalsIndexes {
let client = reqwest::Client::new(); let client = reqwest::Client::new();
log::debug!("Fetching latest CoreBundle from Data Dragon...");
let core = CoreBundle::fetch(&client, "https://dd.b.pvp.net/latest", "en_us").await let core = CoreBundle::fetch(&client, "https://dd.b.pvp.net/latest", "en_us").await
.expect("to be able to fetch `core-en_us` bundle"); .expect("to be able to fetch `core-en_us` bundle");
log::debug!("Fetched latest CoreBundle: it defines {} regions, {} keywords, {} rarities, {} sets, {} spell speeds, and {} vocab terms!", &core.globals.regions.len(), &core.globals.keywords.len(), &core.globals.rarities.len(), &core.globals.sets.len(), &core.globals.spell_speeds.len(), &core.globals.vocab_terms.len());
globals::LocalizedGlobalsIndexes::from(core.globals) globals::LocalizedGlobalsIndexes::from(core.globals)
} }

View file

@ -168,8 +168,13 @@ pub async fn create_cardindex_from_dd_latest_en_us() -> card::CardIndex {
let mut index = card::CardIndex::new(); let mut index = card::CardIndex::new();
for set_code in DD_KNOWN_SET_CODES { for set_code in DD_KNOWN_SET_CODES {
log::debug!("Fetching SetBundle with code {} from Data Dragon...", &set_code);
let set = SetBundle::fetch(&client, "https://dd.b.pvp.net/latest", "en_us", set_code).await let set = SetBundle::fetch(&client, "https://dd.b.pvp.net/latest", "en_us", set_code).await
.expect("to be able to fetch set bundle"); .expect("to be able to fetch set bundle");
log::debug!("Fetched SetBundle with code {}: it defines {} cards!", &set_code, set.cards.len());
for card in set.cards { for card in set.cards {
index.insert(card.code.clone(), card); index.insert(card.code.clone(), card);
} }