Lager Question: how to get the pid:module:function format

Sean Cribbs sean at basho.com
Sat Mar 31 10:29:11 EDT 2012


Bryan,

You'll need to enable Lager's parse transform. The easiest way to do that is to add the {parse_transform, lager_transform} to your compile options in rebar.config.

Sean Cribbs

On Mar 31, 2012, at 3:13 AM, Bryan Hughes <bryan at wobblesoft.com> wrote:

> Hello,
> 
> I have been using Lager for several months now to much success.  One thing that I have not figured out though is how to get our output to match that of what the limited documentation claims.  According to the blog post:
> 
> http://basho.com/blog/technical/2011/07/20/Introducing-Lager-A-New-Logging-Framework-for-ErlangOTP/
> 
> It states:
> 
> Now, those were messages coming out of error_logger, which is fine for legacy or library code, but Lager also has its own logging API that you can       use. It's actually implemented via a parse_transform so that Lager can capture the current module, function, line number and pid for inclusion in the log message. All this is done automatically, and the logging call in the code looks like this:
> 
> lager:error("oh no!")
> lager:warning("~s, ~s and ~s, oh my!"
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120331/1a050da0/attachment.html>


More information about the riak-users mailing list