[erlang-questions] CT: outputting lager debug messages

Alex S. <>
Wed Apr 12 17:38:09 CEST 2017


You’re, iirc, supposed to call lager_common_test_backend:bounce/1, otherwise I’m not sure how it works.
> 8 апр. 2017 г., в 8:48, Bjarne Wichmann Bagge Petersen <> написал(а):
> 
> I have a little issue where I would like to output lager debug-messages when running common tests. But I can't get it to work. 
> 
> In `init_pr_suite` I have 
> 
> application:load(lager),
> application:set_env(lager, handlers, [{lager_console_backend, debug}, {lager_common_test_backend, debug}]),
> 
> And in the test-code I have this little snippet:
> 
>     ct:log("ENV ~p", [application:get_all_env(lager)]),
>     lager:warning("Now you see me"),
>     lager:debug("Now you don't"),
> 
> Which outputs:
> 
> *** User 2017-04-08 07:36:42.089 ***
> ENV [{crash_log_count,5},
>      {crash_log_date,"$D0"},
>      {colored,false},
>      {crash_log_msg_size,65536},
>      {colors,[{debug,"\e[0;38m"},
>               {info,"\e[1;37m"},
>               {notice,"\e[1;36m"},
>               {warning,"\e[1;33m"},
>               {error,"\e[1;31m"},
>               {critical,"\e[1;35m"},
>               {alert,"\e[1;44m"},
>               {emergency,"\e[1;41m"}]},
>      {included_applications,[]},
>      {async_threshold,20},
>      {crash_log_size,10485760},
>      {error_logger_whitelist,[cth_readable_failonly]},
>      {error_logger_redirect,true},
>      {async_threshold_window,5},
>      {crash_log,"log/crash.log"},
>      {error_logger_hwm,50},
>      {handlers,[{lager_console_backend,debug},
>                 {lager_common_test_backend,debug}]}]
> 
> *** User 2017-04-08 07:36:42.090 ***
> 07:36:42.089 [warning] Now you see me
> 
> 
> Missing the debug-line.
> 
> So what am I missing? Is `lager_common_test_backend` the wrong flag? Or is CT muting debug-messages anyway?
> 
> 
> Best regards
> 
> 
> Bjarne Wichmann Bagge Petersen
> 
> Backend Developer, ShopGun
> 
> E:  <mailto:> 
> L: dk.linkedin.com/in/bjarnewp <http://dk.linkedin.com/in/bjarnewp>
> W: shopgun.com <http://shopgun.com/> 
> A: Arne Jacobsens Allé 16, Field's, 3rd floor, DK-2300 København S, Denmark
> 
> ShopGun, your helping hand in shopping, is available at shopgun.com <http://shopgun.com/> and as the ShopGun app <http://shopgun.com/app/download/>.
> 
> This email is intended solely for the addressee and may contain confidential information and/or privileged confidential advice. If you receive this email by mistake, please do not read, print, transmit, store, or in any other way use the email or its attachments. Instead, please notify the addresser immediately and then permanently delete it. Thank you.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170412/a14e02e5/attachment.html>


More information about the erlang-questions mailing list