There is an annotation @Log in the Tapestry fwk which traces, with debug level, the entry and exit of a method.
Is there the same thing for slf4j ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This seems like an unlikely functionality to be packaged with a logging framework.
Tapestry’s
@Logannotation works via its AOP mechanism. Component classes and templates are transformed and advised according to the various annotations on the various fields and methods when they are loaded, which is also how the@Logfunctionality works (via theLogWorkertransformation worker, which looks for the annotation on the component’s methods and wraps the method invocations, putting the actual invocation between logging statements).An annotation packaged with SLF4j would have to do a similar thing, which would be a highly invasive and unpractical thing to do for so little functionality.
If, however, your project uses AOP (e.g. via AspectJ), you could just create your own logging annotation and advice, calling the appropriate SLF4j methods.