I decided to configure lager in the Erlang project. I use erlang.mk, so added
ERLC_OPTS = +'{parse_transform, lager_transform}'
into my makefile. I can run make alland compile modules without errors. I can also start the console erland run the application containing the modules using lager. No errors are generated and lager writes messages during a console session. Everything seems to be in order (this is the first time I've used lager). But, when I run the Common Test, the lager calls fail:
10:11:17.174 [error] CRASH REPORT Process <0.238.0> with 2 neighbours exited with reason: call to undefined function lager:info("Params: ~p", [[]]) in gen_server:init_it/6 line 328
Since it seems that the modules I'm testing were compiled correctly, I assume this is a problem with the missing lager module. However, if I add this:
erlang:display(lager:module_info()),
over the first lager call, this succeeds by printing module information for lager. I assume that the logging calls that I make use a parsing transformation manner to work, and this is not the case during normal test runs.
Any suggestions are welcome!
source
share