Skip to content

clog: pretty-printed, colorful output.

License

Notifications You must be signed in to change notification settings

bradmontgomery/clog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clog

This project is now simply a shortcut for using rich.

If you want to save yourself a dependency, just use rich.

Usage

Pass any data into clog and it'll get pretty-printed.

>>> from clog import clog
>>> data = {'here': 'is some data'}
>>> clog(data)

You can also give it a title:

>>> clog(data, title="My Data")

Or change the color:

>>> clog(data, title="My Data", color="red")

Colors

This library uses rich under the hood, so it theoretically supports any color that rich supports.

Disclaimer

The clog function is now simply a wrapper around:

from rich.panel import Panel
from rich.pretty import Pretty
from rich import print

print(Panel(Pretty(msg), title=title, subtitle=subtitle, border_style=color))

So, seriously... just use rich.