让我们假设我有这个Erlang术语:
{{badmatch,{error,enoent}},[{ts_config_http,parse_config,2,[{file,"src/tsung_controller/ts_config_http.erl"},{line,63}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{ts_config,parse,2,[{file,"src/tsung_controller/ts_config.erl"},{line,437}]},{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},{ts_config,handle_read,3,[{file,"src/tsung_controller/ts_config.erl"},{line,85}]},{ts_config,read,2,[{file,"src/tsung_controller/ts_config.erl"},{line,70}]},{ts_config_server,handle_call,3,[{file,"src/tsung_controller/ts_config_server.erl"},{line,206}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,607}]}]}
我如何将这个术语打印到宽度为80?
2条答案
按热度按时间yvfmudvl1#
You can use
rp
:Even more, if you combine it with
rr/1
you can get nicer results…gmol16392#
我会将术语保存为
Term
,然后使用format/1
打印它。