onflow / flow-cli

The Flow CLI is a command-line interface that provides useful utilities for building Flow applications
https://onflow.org
Apache License 2.0
207 stars 66 forks source link

Progress loggers issues #1022

Open sideninja opened 1 year ago

sideninja commented 1 year ago

Progress reporting should be avoided where possible (in some cases it provides value to CLI users seeing the progress).

There's a possible bug not stopping the progress https://github.com/onflow/flow-cli/blob/93b7336efceb00bf20b3039ca3694cec492ebff9/flowkit/flowkit.go#L310 All the progress reports should be revisited and make sure they can run nicely with multiple go routines.

The logger should support integration with popular go logging libraries (logrus, zap, zerolog).

sideninja commented 1 year ago

We could refactor so the flowkit accepts a logger type that only contains the simple log functions. We could create simple wrappers for popular loggers mentioned above. If there's a need for progress logging we could at that point check whether the passed logger implements the progress functions by comparing to ProgressLogger interface and if it does use it otherwise ignore showing progress. cc @bjartek

bjartek commented 1 year ago

That makes sense to me.