我可以在 Pow 中获得类似于 WEBrick 的 Rails 调试输出吗?
当我使用 Rails/server (WEBrick) 时,我从 Rails 应用程序中获取持续的调试信息(查询等)作为控制台输出。有没有办法用 Pow 获得这个调试输出?
谢谢
When I use rails/server (WEBrick) I get constant debug info (queries, etc) from my rails app as console output. Is there a way to get this debug output with Pow?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以通过在
~/Library/Logs/Pow
目录中您选择的日志文件上运行tail -f
来检查 Pow 收到的 HTTP 请求。查看 Pow 手册中关于查看日志文件的部分。如果您正在查找 Rails 特定日志,它们将是位于应用程序的
log/
目录中。例如,如果您想查看应用程序的开发日志,请切换到应用程序的根目录并运行:还有
less
将为您提供更多选项,但并不完全像使用简单。然后按 ctrl-f 跟踪文件的新输出。按
h
将为您提供更详细的帮助菜单。You can check the HTTP requests that Pow receives by running
tail -f
on the log file of your choice in the~/Library/Logs/Pow
directory. Check out the Pow manual section on Viewing Log FilesIf you're looking for Rails specific logs, they'll be located in the
log/
directory of your application. For instance, if you want to watch the development log for your application switch to the root director of the application and run:There's also
less
which will give you a few more options, but isn't quite as simple to use.and then press
ctrl-f
to follow new output to the file. Pressingh
will give you a more detailed help menu.您还可以使用辅助 gem,例如 powder。我想要显示应用程序日志,只需输入
powder applog
You can also use a helper gem like powder. I order to show application log just type
powder applog
您在应用程序中看到
log/development.log
路径吗?您通常可以使用它来查看 Rails 中发生的情况。还有用于测试和生产的日志,根据应用程序运行的模式,它们可能会出现在您的项目中。要访问这些日志,您应该使用终端和 cd 到您的应用程序,然后您可以使用诸如
tail
之类的实用程序来查看日志。当出现新内容时,tail 命令的一个变体也会滚动输出,就像 Rails 记录器通常所做的那样。Do you see a
log/development.log
path in your application? You can typically use that to see what is taking place within Rails. There are also logs for testing and production as well and they might be present for your project depending on the mode that the application is running in.To access these logs you should use the Terminal and
cd
to your application, you can then use a utility such astail
to see the logs. A variation of the tail command would also scroll the output when there is new content like the Rails logger normally does.使用远程撬动宝石。
参考:
https://github.com/Mon-Ouie/pry-remote
https://coderwall.com/p/sreazq
Use the pry-remote gem.
References:
https://github.com/Mon-Ouie/pry-remote
https://coderwall.com/p/sreazq