Is your feature request related to a problem? Please describe.
I have difficulties to read my logs that are in JSON format. This is a sample log message, it is structured like this:
{"timestamp":"2021-09-07T08:24:40.062Z","level":"INFO","thread":"qtp1533672820-41","logger":"com.gettheaudience.somepackage.UserAppService","message":"BIZEVENT: Subscription 154 updated, new status = PAYING","context":"default"}
Now the frustration comes when I read a log where the "message" field contains new-line \n and tab characters \t, typically exception stack traces generated by Java. On screen, they look like a big bunch of garbled characters because the new-line \n does not cause a line break in cw.
Describe the solution you'd like
I would like that cw gets an option that tells it to replace \n by a real line break, and \t by some number of spaces. This would make my log perfectly readable. It would be a bonus if cw used the entire rules for JSON, e.g. \" should be replaced by ", and so on.
Describe alternatives you've considered
I briefly considered using "jq" with "raw" output for this. However, jq is confused by the other fields in the output from cw, as jq does not know that there is valid JSON later in the line.
Is your feature request related to a problem? Please describe. I have difficulties to read my logs that are in JSON format. This is a sample log message, it is structured like this:
To read these messages, I do this:
This works fine.
Now the frustration comes when I read a log where the "message" field contains new-line
\n
and tab characters\t
, typically exception stack traces generated by Java. On screen, they look like a big bunch of garbled characters because the new-line\n
does not cause a line break in cw.Describe the solution you'd like
I would like that cw gets an option that tells it to replace
\n
by a real line break, and\t
by some number of spaces. This would make my log perfectly readable. It would be a bonus if cw used the entire rules for JSON, e.g.\"
should be replaced by"
, and so on.Describe alternatives you've considered
I briefly considered using "jq" with "raw" output for this. However, jq is confused by the other fields in the output from cw, as jq does not know that there is valid JSON later in the line.