Reputation: 1237
I'm using emacs to view php error logs. The problem is that it's very hard to read when multiple lines are logged. It looks something like this:
[Fri Aug 15 14:55:02 2014] [error] [client 10.10.10.10] WC_Checkout Object\n(\n [posted] => \n [checkout_fields] => Array\n (\n [billing] => Array\n (\n \
[billing_country] => Array\n (\n [type] => country\n [label] => Country\n [required\
] => 1\n [class] => Array\n (\n
OSX has the console log viewer program that formats log files with newlines nicely. Is there anyway I can get emacs (or use another terminal log viewing program) that formats multi-line errors properly? i.e. something like below instead of the above:
[Fri Aug 15 14:55:02 2014] [error] [client 67.161.204.87]
WC_Checkout Object
(
[posted] =>
[checkout_fields] => Array
(
[billing] => Array
(
billing_country] => Array
(
[type] => country
[label] => Country
[required] => 1
)
)
)
)
Upvotes: 1
Views: 61
Reputation: 27812
You can replace \n
with the newline by doing:
M-x replace-string
RET \n
RET C-q C-j.
Upvotes: 1