use native logging formatter
This commit is contained in:
parent
d623d07e13
commit
d905c5da72
1 changed files with 7 additions and 7 deletions
|
@ -51,7 +51,7 @@ def makeItemSetFromList(list, label, key, data):
|
|||
}
|
||||
|
||||
def writeItemSet(id, pos, ver, dir, session):
|
||||
logging.info('Retrieving data for %s at %s' % (id, pos))
|
||||
logging.info('Retrieving data for %s at %s', id, pos)
|
||||
data = getChampData(id, pos, session)
|
||||
|
||||
item_set = {
|
||||
|
@ -71,7 +71,7 @@ def writeItemSet(id, pos, ver, dir, session):
|
|||
item_set['blocks'].append(makeItemSetFromList(CONSUMABLES, "Consumables | Frequent: %s", 'mostGames', data))
|
||||
item_set['blocks'].append(makeItemSetFromList(TRINKETS, "Trinkets | Wins: %s", 'highestWinPercent', data))
|
||||
|
||||
logging.info('Writing item set for %s at %s' % (id, pos))
|
||||
logging.info('Writing item set for %s at %s', id, pos)
|
||||
with open(dir.joinpath('CGG_%s_%s.json' % (id, pos)), 'w', newline='\n') as out:
|
||||
json.dump(item_set, out, indent=4)
|
||||
|
||||
|
@ -87,13 +87,13 @@ def main():
|
|||
data = session.get('http://ddragon.leagueoflegends.com/cdn/%s/data/en_US/champion.json' % ver).json()['data']
|
||||
lol_champs = [data[i] for i in data]
|
||||
|
||||
logging.info('LoL version: %s' % ver)
|
||||
logging.info('LoL numbers of champs: %d' % len(lol_champs))
|
||||
logging.info('LoL version: %s', ver)
|
||||
logging.info('LoL numbers of champs: %d', len(lol_champs))
|
||||
|
||||
(champs, patch) = getChampsWithPositionsAndPatch(session)
|
||||
|
||||
logging.info('CGG version: %s' % patch)
|
||||
logging.info('CGG numbers of champs: %d' % len(champs))
|
||||
logging.info('CGG version: %s', patch)
|
||||
logging.info('CGG numbers of champs: %d', len(champs))
|
||||
|
||||
for champ in champs:
|
||||
for name, positions in champ.items():
|
||||
|
@ -105,7 +105,7 @@ def main():
|
|||
writeItemSet(c['id'], pos, patch, path, session)
|
||||
sleep(random.uniform(.3, .4))
|
||||
else:
|
||||
logging.error('%s not found in LoL champs' % name)
|
||||
logging.error('%s not found in LoL champs', name)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Add table
Reference in a new issue