reubano / pygogo

A Python logging library with superpowers
MIT License
281 stars 20 forks source link

csv formatter output invalid #18

Closed micimize closed 2 years ago

micimize commented 5 years ago
>>> gogo.Gogo(name="root", low_formatter=gogo.formatters.csv_formatter).info('..."hmm"')
# stdout:
# 2019-02-23 10:00:02.825,root.base,INFO,"..."hmm""

It should use a real csv formatter

reubano commented 5 years ago

Can you please show an example of the expected output?

micimize commented 5 years ago

It seems the most standard dublequote-handling csv pattern is quote-escaping (" -> ""): 2019-02-23 10:00:02.825,root.base,INFO,"...""hmm"""

micimize commented 5 years ago

but I think really csv_formatter should take csv.writer arguments aside from the target, and should init and return a csv.writer wrapping formatter similar to the SO answer