代码之家  ›  专栏  ›  技术社区  ›  Jeremy Raymond

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

  •  5
  • Jeremy Raymond  · 技术社区  · 16 年前

    我正在尝试启动一个失败的Erlang应用程序。我在shell中看到的是:

    =INFO REPORT==== 7-Jan-2010::17:37:42 ===
        application: ui
        exited: {shutdown,{ui_app,start,[normal,[]]}}
        type: temporary
    

    如何让Erlang向我提供有关应用程序未启动原因的更多信息?shell中当前没有其他输出。

    3 回复  |  直到 16 年前
        1
  •  13
  •   jldupont    16 年前

    erl -boot start_sasl

        2
  •  2
  •   legoscia    13 年前

    有一个 patch (tp/主管传递错误)包含在R16B版本中。此修补程序使退出原因出现在应用程序停止日志消息中,从而比 {shutdown,{ui_app,start,[normal,[]]}} -到目前为止,我们已经收到了一些风格信息。

    这是中的条目 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)
    
        3
  •  0
  •   Gordon Guthrie    16 年前

    这是一种痛苦,但我这样做的方式是老式的,将io:format写入应用程序的启动函数(即具有应用程序行为的模块代码),并找出哪一行失败:(

    有时候暴力和无知是你唯一的男人。。。