diff --git a/api/api/routes.py b/api/api/routes.py index eea1d5f..b8afab0 100644 --- a/api/api/routes.py +++ b/api/api/routes.py @@ -1,3 +1,5 @@ +import logging + from flask import Blueprint, current_app, jsonify, request from web3 import Web3 @@ -69,7 +71,7 @@ def _ask(request_data, request_headers, validate_captcha=True, validate_csrf=Tru try: # convert recipient address to checksum address recipient = Web3.to_checksum_address(validator.recipient) - print(f"will try to send {amount_wei} to {recipient}") + logging.info(f'will try to send {amount_wei} to {recipient}') w3 = Web3Singleton(current_app.config['FAUCET_RPC_URL'], current_app.config['FAUCET_PRIVATE_KEY']) @@ -79,13 +81,13 @@ def _ask(request_data, request_headers, validate_captcha=True, validate_csrf=Tru current_app.config['FAUCET_ADDRESS'], recipient, amount_wei) - print(f"native token txn: {tx_hash}") + logging.info(f'native token txn: {tx_hash}') else: tx_hash = claim_token(w3, current_app.config['FAUCET_ADDRESS'], recipient, amount_wei, validator.token.address) - print(f"token with address txn: {validator.token.address}") + logging.info(f'token with address {validator.token.address} txn: {tx_hash}') # save transaction data on DB transaction = Transaction()