Skip to content

Use Typer's echo for output in cli.py #70

@stratofax

Description

@stratofax

As recommended in [Logging HOWTO ](https://docs.python.org/3.8/howto/logging.html#basic-logging-tutorial) if you want to "Display console output for ordinary usage of a command line script or program" the "best tool for the task" is print(), or in this case, the Typer equivalents, echo or secho.

During development, using logging as a unified messaging and notification channel is extremely useful, especially considering pytest's support for logging -- see [Logging — pytest documentation](https://docs.pytest.org/en/6.2.x/logging.html).

For production code, however, using Typer's echo or secho may be the better choice, especially since Typer offers fine grained control over the formatting of the output string, including color.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions