首页 > 代码库 > 在rebar发布的项目中添加监视工具

在rebar发布的项目中添加监视工具

默认使用rebar创建的项目没法使用observer,可以如下操作

 

修改app.src

{application, tcp_server,    [        {description, ""},        {vsn, "0.1"},        {registered, []},        {applications, [            debugger,            observer,            kernel,            stdlib        ]},        {mod, { tcp_server_app, []}},        {env, [            {listen_port,7000}        ]}    ]}.

 

或者是rel目录的reltool.config

{sys, [       {lib_dirs, ["../apps", "../deps"]},       {erts, [{mod_cond, derived}, {app_file, strip}]},       {app_file, strip},       {rel, "tcp_server", "0.1",        [         kernel,         stdlib,         sasl,         tcp_server        ]},       {rel, "start_clean", "",        [         kernel,         stdlib        ]},       {boot_rel, "tcp_server"},       {profile, embedded},       {incl_cond, derived},       {excl_archive_filters, [".*"]}, %% Do not archive built libs       {excl_sys_filters, ["^bin/(?!start_clean.boot)",                           "^erts.*/bin/(dialyzer|typer)",                           "^erts.*/(doc|info|include|lib|man|src)"]},       {excl_app_filters, ["\.gitignore"]},       {app, tcp_server, [{mod_cond, app}, {incl_cond, include}]}      ]}.

rebar generate以后,直接生成

 

具体模块名字可以用reltool:start().查看

在rebar发布的项目中添加监视工具