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:
parent
384d209b5c
commit
27911378dd
2 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue