如何确定 Erlang 应用程序未启动的原因?

发布于 2024-08-16 19:39:54 字数 264 浏览 6 评论 0原文

我正在尝试启动一个失败的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

肥爪爪 2024-08-23 19:39:54

您可以尝试启动具有更多日志记录支持的 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.

心奴独伤 2024-08-23 19:39:54

有一个 补丁 (tp/supervisor-pass-on-errors) 包含在释放R16B。此补丁使退出原因出现在应用程序停止日志消息中,这比我们已有的 {shutdown,{ui_app,start,[normal,[]]}} 风格的消息更有用到目前为止。

这是自述文件中的条目:

OTP-10490 == 标准库 ==

    如果子进程的启动函数失败,那么
    错误原因之前仅作为错误报告报告
    来自 error_handler 和supervisor:start_link 只会
    返回{错误,关闭}。这已被更改,因此
    主管现在将返回 {error,{shutdown,Reason}},其中
    Reason 标识失败的子项及其错误原因。
    (感谢托马斯·皮尔)

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:

OTP-10490  == stdlib ==

    If a child process fails in its start function, then the
    error reason was earlier only reported as an error report
    from the error_handler, and supervisor:start_link would only
    return {error,shutdown}. This has been changed so the
    supervisor will now return {error,{shutdown,Reason}}, where
    Reason identifies the failing child and its error reason.
    (Thanks to Tomas Pihl)
梦里寻她 2024-08-23 19:39:54

这是一种痛苦,但我这样做的方式是老式的方式,通过将 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文