[erlang-questions] Integrating lager into our app

Martin Koroudjiev mrtndimitrov@REDACTED
Thu Jan 21 15:56:13 CET 2016


Hello,

I am trying to include lager into our application but I am having
problems. I include the lager ebin directory on startup with: -pa
"../lib/lager-2.0.3/ebin"
Then I start lager with: lager:start().
I define a constant as: -define(dbg(Fmt), lager:debug(Fmt)).
But when I try to use it in the code:
?dbg("Hello").
it says: ** exception error: undefined function lager:debug/1

I've checked lager's help page on github and saw that a parse_transform
must be set to lager_transform. Why is this needed?

And how to actually do it? I compile my source files with erlc and pass
the transform option with +"{parse_transform, lager_transform}" but then
the code doesn't compile because lager_transform module is not present
at that time.

Thank you,
Martin



More information about the erlang-questions mailing list