jazzband / prettytable

Display tabular data in a visually appealing ASCII table format
https://pypi.org/project/PrettyTable/
Other
1.32k stars 149 forks source link

Pretty printing inside cloudwatch logs #255

Closed slidenerd closed 10 months ago

slidenerd commented 10 months ago

Is your feature request related to a problem? Please describe.

RIght now the prettytable does not format neatly when displayed inside cloudwatch logs.

Describe the solution you'd like

A workaround to print the table nicely inside cloudwatch logs would be awesome

Describe alternatives you've considered

none

Additional context

Add any other context or screenshots about the feature request here.

image

table looks good inside terminal but messy inside cloudwatch logs

hugovk commented 10 months ago

I'm not sure how much sense it is to output a table in line-based logging, given that the cloudwatch viewer seems to be squashing multiple spaces into one, which PrettyTable has no control over.

One thing you could do is avoid ANSI colouring the text, that would skip the 0;32; etc codes.