Erlang/Elixir Erlang 日志模块 lager

linus · October 07, 2015 · Last by flowerwrong replied at October 07, 2015 · 2473 hits

https://github.com/basho/lager

下面这种用法,我试过在交互模式是不行的。 Once you have built your code with lager and started the lager application, you can then generate log messages by doing the following:

lager:error("Some message") Or:

lager:warning("Some message with a term: ~p", [Term]) The general form is lager:Severity() where Severity is one of the log levels mentioned above.

因为 larger.erl 里没有那几个方法。你可以自己定义。或者发个 PR

#1 楼 @alixiaomiao 不是的,我在文件里面可以。lager:info("Payloadlen is ~p, alrpl is ~p~n", [PayLoadLength, Alrpl]) 交互式 shell 里面不行。

#2 楼 @flowerwrong 你用了 parse_transform 吧

You need to Sign in before reply, if you don't have an account, please Sign up first.