[erlang-questions] Logging methods in Erlang (FUNCTION macro)

Michael Truog mjtruog@REDACTED
Sat Sep 6 02:07:17 CEST 2014


On 09/05/2014 04:29 PM, Loïc Hoguin wrote:
> On 09/06/2014 01:19 AM, Steve Vinoski wrote:
>>
>>
>>
>> On Fri, Sep 5, 2014 at 6:41 PM, Loïc Hoguin <essen@REDACTED
>> <mailto:essen@REDACTED>> wrote:
>>
>>     On 09/05/2014 11:25 PM, Michael Truog wrote:
>>
>>
>>         2) Use a parse transform to rewrite all the source code that
>>         wants to do
>>         logging so that it can determine whether it needs to log by checking
>>         global state, probably in ets.  This approach is taken in lager
>>         with the
>>         parse transform at
>> https://github.com/basho/__lager/blob/master/src/lager___transform.erl
>> <https://github.com/basho/lager/blob/master/src/lager_transform.erl>
>>         .
>>
>>
>>     I do not like this one, especially since lager will simply fail if
>>     modules were not compiled with the parse_transform (the functions
>>     aren't defined). So you have to compile everything with it, can't
>>     call from the shell (at least not the same way), yada yada. Very
>>     impractical. Efficiency is always good to have but that one is quite
>>     costy.
>>
>>
>> Instead of complaining in text, how about contributing in code? If
>> there's something you don't like about lager, Andrew is easy to find in
>> IRC or on email -- discuss your concerns with him, propose a solution,
>> and submit a PR. Andrew is quite reasonable and pragmatic.
>
> That wasn't a complaint. I am not a lager user. There was two different ways of doing things in the original post, and I simply explained which one I prefer and why.
>
> In general anything involving parse transforms will receive a negative opinion from me. I am not going to go to every single project I am not using to tell them why I don't think they're doing the right thing, though.
>
I agree.  If you believe the first approach is better, to improve lager would be to rewrite it.





More information about the erlang-questions mailing list