2014-03-26 56 views
1

我有一些EUnit测试,作为其设置/拆卸过程的一部分启动和停止某些应用程序。悄悄停止应用程序

应用程序停止任何时候,二郎神像输出

=INFO REPORT==== 26-Mar-2014::10:43:18 === 
    application: asn1 
    exited: stopped 
    type: temporary 

用大圆木,斑点我使用的EUnit代码

my_test_() -> 
    {setup, 
    fun() -> 
     {ok, Apps} = application:ensure_all_started(my_app) 
    end, 
    fun({ok, AppList}) -> 
     lists:foreach(fun (App) -> application:stop(App) end, AppList) 
    end, 
    [ 
     ?_test(first_test()) 
     ,?_test(second_test()) 
    ]}. 

这让我所有的应用程序的列表那开始为我的my_app应用程序,然后该值传回到关闭功能,停止每个这些。

有什么我可以做的,以保持Erlang安静的应用程序关闭?它会输出很多文字,并且很难找到我关心的输出。

回答

2

是的,你可以写:

queit_stop(App) -> 
    error_logger:tty(false), 
    Res = application:stop(App), 
    error_logger:tty(true), 
    Res.