问题描述
pprint
/ println
输出在哪里组合?/我可以在终端中显示它吗?在运行Figwheel repl的窗口? (抱歉,这听起来很愚蠢,谷歌竭尽全力。)
Where does pprint
/println
output go in compojure?/Can I get it to show up in the terminal window that the figwheel repl is running in? (Sorry if this sounds dumb, google bested my efforts).
推荐答案
实际上Figwheel具有引起此类症状的相关功能。环形处理程序中的所有print / prn语句将被Figwheel进程吞噬,并进入日志文件或控制台。
Actually Figwheel has a related feature to cause such symptoms. All print/prn statements in your ring handlers will be "swallowed" by the Figwheel process and will either go to a log file or to the console.
这是project.clj的摘录:
Here is a snippet from project.clj:
:figwheel
{:http-server-root "public"
:server-port 3449
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:ring-handler myapp.handler/app
:server-logfile false
}
密钥:server-logfile正在控制此行为。如果为假,则 out 是常规的repl控制台,如果它是文件名,则打印的所有内容都将进入该文件(如果不存在,则默认使用文件 figwheel_server.log。
The key :server-logfile is controlling this behavior. If it's false, then out is your regular repl console, if it's a filename, then anything printed will go to that file (if it's not present, then the default is using file "figwheel_server.log".
Figwheel问题:
Figwheel提交:
Figwheel issue:https://github.com/bhauman/lein-figwheel/issues/436Figwheel commit: https://github.com/bhauman/lein-figwheel/commit/330d8d7fda8be145615910cf639bd9a3242339ba
这篇关于将compojure服务器打印语句输出到figwheel终端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!