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

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

Open
stratofax opened this issue Aug 16, 2022 · 0 comments
Open

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

stratofax opened this issue Aug 16, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@stratofax
Copy link
Collaborator

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.

@stratofax stratofax self-assigned this Aug 16, 2022
@stratofax stratofax added the enhancement New feature or request label Aug 16, 2022
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

1 participant