Skip to content

Add color to warnings #818

@bhrutledge

Description

@bhrutledge

While working on #815 and #817, I remembered a suggestion for this. I think it would make them more obvious.

pip does this, with a custom logging.StreamHandler.

There are also a couple packages that hook into logging and use colorama (which Twine already uses for the red errors):

I think part of implementing this should be normalizing the way Twine reports warnings; it currently uses logger.warning and warnings.warn. It seems like the former is preferable for this purpose, although logging.captureWarnings could be a fallback.

Similarly, we might want to rework the red error implementation from #649 to use logger.error.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions