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

Retrieve Blockchain logs #114

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

m-Peter
Copy link
Contributor

@m-Peter m-Peter commented May 18, 2023

Work towards: onflow/developer-grants#148
Companion PR: onflow/cadence#2505 ✔️

Description

Provides a way to retrieve logs from the Blockchain, programmatically, from the testing framework, with:

import Test

pub let blockchain = Test.newEmulatorBlockchain()

blockchain.logs()

Also improves the look & feel for logs that come from test files. E.g:
Screenshot from 2023-05-22 16-43-44


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@m-Peter m-Peter changed the title WIP: Retrieve Blockchain events WIP: Retrieve Blockchain logs May 18, 2023
@m-Peter
Copy link
Contributor Author

m-Peter commented May 18, 2023

Screenshot from 2023-05-18 16-35-59

Logs from test files are consistent with the blockchain logs. The INF logs are the blockchain logs, which we could return to the test file

@m-Peter m-Peter force-pushed the logging-improvements branch from f1776ac to 98c94ad Compare May 22, 2023 13:43
@m-Peter m-Peter changed the title WIP: Retrieve Blockchain logs Retrieve Blockchain logs May 22, 2023
@m-Peter m-Peter marked this pull request as ready for review May 22, 2023 13:47
@m-Peter m-Peter force-pushed the logging-improvements branch from ca959cd to 10caeb0 Compare May 23, 2023 07:39
test/test_runner.go Outdated Show resolved Hide resolved
test/test_runner.go Outdated Show resolved Hide resolved
test/test_runner.go Show resolved Hide resolved
test/test_framework_test.go Outdated Show resolved Hide resolved
test/test_runner.go Show resolved Hide resolved
Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far!

test/test_framework_test.go Outdated Show resolved Hide resolved
@m-Peter m-Peter force-pushed the logging-improvements branch from cf73b81 to 32fca2c Compare June 6, 2023 13:27
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👌

@turbolent turbolent self-assigned this Jun 6, 2023
@turbolent turbolent merged commit cda82f7 into onflow:master Jun 6, 2023
@SupunS SupunS mentioned this pull request Jun 6, 2023
6 tasks
@m-Peter m-Peter deleted the logging-improvements branch June 7, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants