Skip to content

Colorize logging based on log level #206

Description

@TimidRobot

Problem

It can be difficult to identify anomalies in a a stream of text.

Description

Colorize messages based on log level.

Log levelColor nameColor code
logging.DEBUGBright Black90
logging.INFOWhite37
logging.WARNINGBright Yellow93
logging.ERRORBright Red91
logging.CRITICALRed31

Note: This intentionally differs from ccos-scripts:
https://github.com/creativecommons/ccos-scripts/blob/1809eb6ab8f8ed4ce51b7f0ce5ae581f0a3556a3/ccos/log.py#L15-L23

Environment

python_version = "3.11"

Additional context

Implementation

  • I would be interested in implementing this feature.

Metadata

Metadata

Labels

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions