sharkdp / bat

A cat(1) clone with wings.
Apache License 2.0
49.87k stars 1.26k forks source link

How to use as a module ? #3109

Open Aviksaikat opened 1 month ago

Aviksaikat commented 1 month ago

How can we use bat as a module and use it for colourful logging and terminal outputs from rust programs?

keith-hall commented 1 month ago

https://github.com/sharkdp/bat?tab=readme-ov-file#development

If you want to build an application that uses bats pretty-printing features as a library, check out the the API documentation. Note that you have to use either regex-onig or regex-fancy as a feature when you depend on bat as a library.

Aviksaikat commented 1 month ago

Do we have to create a new instance of PrettyPrinter every time we want to print out something?