takashi-ishio / selogger

(Near-)omniscient debugging/tracing/logging tool for Java
Other
35 stars 8 forks source link

Debugging setup of the agent! #32

Closed prakharporwal closed 1 year ago

prakharporwal commented 1 year ago

Hi @takashi-ishio I am trying to other feature on the project and run a project with this agent!

Do you gave a setup for debugging the project by running it and attaching a debugger ?

Is there a faster SDLC for this which you use on the project ?

Thanks

takashi-ishio commented 1 year ago

Thank you for your interest to the project. I use breakpoints and single step execution on Eclipse by the following steps.

As the agent binary includes debugging information (file names and line numbers), the Source Lookup Path enables Eclipse to open corresponding files.

prakharporwal commented 1 year ago

Thank you for responding! @takashi-ishio I was thinking if it is possible to have some like of hot reload feature. or class file replacement on the go. So we don't have to build the agent again and again ?

takashi-ishio commented 1 year ago

Thank you for the comment.
While hot reload cannot be a part of SELogger itself, I found a workaround: You can configure the class path to enforce JVM to load a class from a directory rather than a JAR file. In case of OpenJDK on Eclipse:

-Xbootclasspath/a:${project_loc:selogger}\target\classes -javaagent:${project_loc:selogger}\target\selogger-0.5.0.jar=e=org.objectweb.asm,e=com.fasterxml.jackson.core

When you modify a source file, the updated class file will be reloaded by the debugger (if it is possible). The e= options are to remove SELogger's dependencies from logging.