onflow / cadence-tools

Developer tools for Cadence
https://www.onflow.org/
Apache License 2.0
24 stars 20 forks source link

[Test] Allow custom logger for the test runner #269

Closed jribbink closed 8 months ago

jribbink commented 8 months ago

Issue to be solved

Currently, there is no way to provide a custom logger to the test runner and this defaults to stdio. This is problematic because sometimes developers may want to suppress, format, or display logs in a different way. (Currently, this is creating an issue in Flow CLI https://github.com/onflow/flow-cli/issues/1324).

This is related to the bug encountered in https://github.com/onflow/cadence-tools/issues/265

Suggested Solution

Add an additional builder function, WithLogger which allows the developer to specific a custom zerolog context. The default logger may either be stdio or suppressed.