lines4logs

Logging frameworks, such as log4j, already have an option to add the line of code to the log output. However, the implementation is extremely inefficient and expensive to run in the production environment. Each time the log line is being printed, the new Exception instance has to be created to get to the source line.

 

lines4logs implementation doesn't have the above problem. It introduces a new step into your build process that modifies your project java sources prior to compilation step, including the line numbers directly into the sources.

 

Original code:

logger.info("Hello Lines!");

 

The same code after it has been processed with lines4logs becomes:

logger.info("C:/projects/lines4logs/example/src/main/java/com/appdynamics/lines4logs/example/HelloLines.java:16 "+"Hello Lines!");


lines4logs is based on the Spoon framework
http://spoon.gforge.inria.fr/

Attachments: