Lager issue

John Kemp john at jkemp.net
Thu Jan 10 13:11:18 EST 2013


Hi,

I don't usually have issues with lager, but in logging for my application, I feel like I've done all the right things:

i) Put lager_transform in my rebar config:

{erl_opts, [debug_info, warnings_as_errors, {parse_transform, lager_transform}]}.

ii) Lager is started when my app starts, and I know by asking at the console:

(lilith at 127.0.0.1)3> application:which_applications().
[{lilith,[],"1"},
 {lager,"Erlang logging framework","0.9.4"},
 {crypto,"CRYPTO version 2","2.2"},
 {sasl,"SASL  CXC 138 11","2.2.1"},
 {stdlib,"ERTS  CXC 138 10","1.18.3"},
 {kernel,"ERTS  CXC 138 10","2.15.3"}]

Then:

(lilith at 127.0.0.1)4> application:start(lager).
{error,{already_started,lager}}

And yet... 

(lilith at 127.0.0.1)5> lager:info("foo ~s", [bar]).     
** exception error: undefined function lager:info/2
(lilith at 127.0.0.1)6> lager:error("foo ~s", [bar]).
** exception error: undefined function lager:error/2
(lilith at 127.0.0.1)7> lager:warning("foo ~s", [bar]).
** exception error: undefined function lager:warning/2
(lilith at 127.0.0.1)8> lager:info("Hello!").                   
** exception error: undefined function lager:info/1

Can anyone tell me why lager continues to give me 'undef'?

Cheers,

JohnK



More information about the riak-users mailing list