Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Logging results to console #53

Open
0xcivita opened this issue Feb 14, 2024 · 2 comments
Open

feat: Logging results to console #53

0xcivita opened this issue Feb 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@0xcivita
Copy link

Overview

Results returned from handlers are currently intended to be stored in a DB (from docs), but it would be great to also see these results in console logs as the bot is running.

Specification

Using example.py, potentially log what would be stored in a results DB to the console. So, the event handler

# This is how we trigger off of events
# Set new_block_timeout to adjust the expected block time.
@app.on_(USDC.Transfer, start_block=18588777, new_block_timeout=25)
# NOTE: Typing isn't required
def exec_event1(log):
    if log.log_index % 7 == 3:
        # If you ever want the app to shutdown under some scenario, call this exception
        raise CircuitBreaker("Oopsie!")
    return {"amount": log.amount}

would log {"amount": log.amount} for each log handled.

@0xcivita 0xcivita added the enhancement New feature or request label Feb 14, 2024
Copy link

linear bot commented Feb 14, 2024

@fubuloubu
Copy link
Member

@0xcivita do you have an example usecase of why this specifically should be displayed in the logs? Or are you more generally looking to view live datapoints from your bot similar to as described in #59?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants