如何确定 Erlang 应用程序未启动的原因?
我正在尝试启动一个失败的 Erlang 应用程序。我在 shell 中看到的只是:
=INFO REPORT==== 7-Jan-2010::17:37:42 ===
application: ui
exited: {shutdown,{ui_app,start,[normal,[]]}}
type: temporary
如何让 Erlang 为我提供有关应用程序未启动原因的更多信息?目前 shell 中没有其他输出。
I'm trying to start an Erlang app that is failing. All I see in the shell is:
=INFO REPORT==== 7-Jan-2010::17:37:42 ===
application: ui
exited: {shutdown,{ui_app,start,[normal,[]]}}
type: temporary
How can I get Erlang to give me more information as to why the application is not starting? There currently is no other output in the shell.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试启动具有更多日志记录支持的 shell:
erl -boot start_sasl
这可能会提供更多详细信息。
You could try launching the shell with more logging support:
erl -boot start_sasl
this might get give a bit more details.
有一个 补丁 (tp/supervisor-pass-on-errors) 包含在释放R16B。此补丁使退出原因出现在应用程序停止日志消息中,这比我们已有的
{shutdown,{ui_app,start,[normal,[]]}}
风格的消息更有用到目前为止。这是自述文件中的条目:
There is a patch (tp/supervisor-pass-on-errors) that was included in release R16B. This patch makes exit reasons appear in application stop log messages, which thus become much more useful than the
{shutdown,{ui_app,start,[normal,[]]}}
-style messages we've had until now.This is the entry in the README:
这是一种痛苦,但我这样做的方式是老式的方式,通过将 io:format 写入应用程序的启动函数(即具有应用程序行为的模块的代码)并计算出哪一行失败:(
有时候,暴力和无知是你唯一的依靠……
It is a pain, but the way I do it is the old fashioned way, by writing io:format's into the start function of the application (ie the code of the module with the behaviour of application) and working out which line fails :(
Sometimes brute force and ignorance is your only man...