Print => logger

This commit is contained in:
Luke Van Seters 2021-11-18 13:47:59 -05:00
parent d499983f32
commit 023205c25b
2 changed files with 4 additions and 3 deletions

5
cli.py
View File

@ -13,6 +13,7 @@ from mev_inspect.prices import fetch_all_supported_prices
RPC_URL_ENV = "RPC_URL" RPC_URL_ENV = "RPC_URL"
logging.basicConfig(stream=sys.stdout, level=logging.INFO) logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logger = logging.getLogger(__name__)
@click.group() @click.group()
@ -86,10 +87,10 @@ async def inspect_many_blocks_command(
async def fetch_all_prices(): async def fetch_all_prices():
inspect_db_session = get_inspect_session() inspect_db_session = get_inspect_session()
print("Fetching prices") logger.info("Fetching prices")
prices = await fetch_all_supported_prices() prices = await fetch_all_supported_prices()
print("Writing prices") logger.info("Writing prices")
write_prices(inspect_db_session, prices) write_prices(inspect_db_session, prices)

2
mev
View File

@ -60,7 +60,7 @@ case "$1" in
shift shift
case "$1" in case "$1" in
fetch-all) fetch-all)
echo "running fetch-all" echo "Running price fetch-all"
kubectl exec -ti deploy/mev-inspect -- \ kubectl exec -ti deploy/mev-inspect -- \
poetry run fetch-all-prices poetry run fetch-all-prices
;; ;;