--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.
--
--
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-erlang+unsub...@googlegroups.com.
To post to this group, send email to lisp-flavoured-erlang@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
On Thu, Jan 22, 2015 at 11:24:27AM -0600, Duncan McGreggor wrote:
> Hey Robert,
>
> I've included some lager contributors in this response (the creator and
> biggest contributor as well as the recent release manager) -- hopefully we
> can get this cleared up (I am afraid I don't know enough about lager to be
> able to answer with any confidence).
>
> Andrew and Jon, as Robert asked below, we're trying to sort out what lager
> does with parse transforms so that LFE can duplicate this with macros (if
> possible) in the hopes that we can reuse the rest of lager (LFE can't use
> Erlang parse transforms).
>
> >From what I've seen, the parse transforms in lager allow lager to provide
> to various logs functions information such as calling module, calling
> function, line number of call, and process id of calling function. It also
> supports the user making additional data besides these (however, I don't
> know how much that last one depends upon parse transforms). The parse
> transoms are wrapped such that if a log level threshold is not met, nor
> more code than necessary is executed.
Yes, this is the main thing that happens (although you could easily do
just this with a macro). The lager parse transform does a bunch of other
nice things with the callsite, it captures ?LINE, ?MODULE and function
(which isn't available via a builtin macro). If you don't have a parse
transform, though, I think it can all be done with macros (maybe not
function name capture, don't know if LFE exposes that). Lager also does
some other nice things with its parse transform, like stashing
information about records it has seen in the module, so they can be
prettyprinted later, and figuring out what application a module belongs
to (so you can partition logs by application).
All in all, though, you can probably do the majority of it with a macro.
Indeed, I've considered adding macros to lager so people can stop
complaining about the evils of parse transforms.
Andrew