Would this work via code generation, bytecode weaving (compile time or as a
Java agent at runtime), reflection, or some other mechanism I’m not
thinking of? Lombok goes further and modifies the AST at compile time as if
Java supported macros, so that’s not the most straightforward route of
implementation by any means.

I’d love a good implementation of such a feature, though, if we can figure
it out.

On Thu, Jul 19, 2018 at 09:26, Rob Tompkins <chtom...@gmail.com> wrote:

>
>
> > On Jul 19, 2018, at 10:17 AM, Gary Gregory <garydgreg...@gmail.com>
> wrote:
> >
> > On Thu, Jul 19, 2018 at 8:07 AM Rob Tompkins <chtom...@gmail.com> wrote:
> >
> >>
> >>
> >>> On Jul 19, 2018, at 9:29 AM, Gary Gregory <garydgreg...@gmail.com>
> >> wrote:
> >>>
> >>> Annotation-based logging comes up once in a while here but we have not
> >>> implemented it. Project Lombok does that IIRC.
> >>
> >> Any reason for having not yet implemented it, or just the standard
> “time”?
> >>
> >
> > It's just more "stuff" and yes, time. And also, no one's wanted to put
> the
> > time in.
> >
> > But then there are design issues and adding more "stuff" to the API jar.
> >
> > - Would you allow @Log(level=Level.TRACE) (should be the default?) and
> > @Log(level=Level.DEBUG)
> > - What happens if you say both?
> > - Should you be able to break it up and only say @LogEntry() or
> @LogExit().
> > - What about @Log(file="${user.home}\foo.log")
> > - and on and on ;-)
>
> Definitely fair points, I think I would try to go as simple as possible in
> a first pass…right?
>
> @Log
> @Log(level=X)
>
> -Rob
>
> >
> > Gary
> >
> >
> >>
> >>>
> >>> Gary
> >>>
> >>> On Thu, Jul 19, 2018, 07:15 Rob Tompkins <chtom...@gmail.com> wrote:
> >>>
> >>>> Hey folks,
> >>>>
> >>>> I’m curious if anyone has thought about adding a class level @Log
> >>>> annotation such that upon debug or trace configuration, method entry
> and
> >>>> exit gets automatically logged?
> >>>>
> >>>> -Rob
> >>
> >>
>
> --
Matt Sicker <boa...@gmail.com>

Reply via email to