roboflow / roboflow-python

The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.
https://docs.roboflow.com/python
Apache License 2.0
311 stars 77 forks source link

no print, only log #316

Closed asymptotic closed 2 months ago

asymptotic commented 2 months ago

Description

No print, only log: I'm working on a project that uses roboflow-python and rather than making changes to suppress stdout for this module, I updated it to use a Python logger instead.

Every module gets its own logger using logging.getLogger(__name__).

Everything is logged as INFO.

The logger uses f-strings because the optimization benefit for not using them really doesn't matter here. Ruff now ignores G003 and G004 as a result.

Type of change

How has this change been tested, please provide a testcase or example of how you tested the change?

Ruff and mypy checks pass.

Any specific deployment considerations

I know there are still interactive prompts in there; for my next trick, I might figure out something to do with them for when running in a non-interactive environment.

asymptotic commented 2 months ago

let me do some more updates and I'll resubmit on a different branch!