Record Java comments

Are there any libraries that can record variables by adding comments:

@Log
String someValueToLog = someMethod(); 
@Log(level="debug",prefix="Here's the value=")
String someValueToLogAgain = someMethod();

This function is similar to adding this line to the code:

log.info(someValueToLog);
log.debug("Here's the value="+someValueToLogAgain);

Solution

You need to write custom comments for this This is an attempt to use AspectJ AOP:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>