TheBlackBird
TheBlackBird

Reputation: 85

Status Monitor in Eclipse?

I am pretty new at developing larger software and I am using Eclipse as IDE.

When my program is running, I want to have certain informations about the status in different classes (like values of certain objects). Up until now I was just printing it all out on the console with System.out.println(object.value);.

After a while the console became confusing with all the different values printed higgledy-piggledy. Now I am searching for a plugin or something, with which I can do something like

StatusMonitor monitorSize = new StatusMonitor();
StatusMonitor monitorHeight = new StatusMonitor();
monitorSize.print(object.size);
monitorHeight.print(object.height);

And then Eclipse has two different terminals/windows where the specific variables are printed.

Is there a possibility to achieve that?

Upvotes: 0

Views: 145

Answers (1)

GURMEET SINGH
GURMEET SINGH

Reputation: 111

YOU SHOULD DEBUG IT. FOR THIS ADD BREAKPOINTS IN THE CODE(To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint. Alternatively you can double-click on this position.) WHERE YOU WANT TO CHECK THE VALUES OF VARIABLES. WHEN YOU HAVE PUT THE BREAKPOINTS IN YOUR CODE THEN RIGHT CLICK ON THE CLASS WITH MAIN METHOD THEN SELECT --> DEBUG AS--> JAVA APPLICATION. THEN A DIALOG BOX WLL OPEN CLICK YES ON IT AND NOW YOUR CODE WILL BE OPEN IN DEBUG MODE. ON THE TOP PANEL .There will be options such as STEP INTO ETC. ALSO THERE WILL ARE FEW SHORTCUTS: F5-->Executes the currently selected line and goes to the next line in your program. If the selected line is a method call the debugger steps into the associated code. F6-->F6 steps over the call, i.e. it executes a method without stepping into it in the debugger. F7-->F7 steps out to the caller of the currently executed method. This finishes the execution of the current method and returns to the caller of this method. F8-->F8 tells the Eclipse debugger to resume the execution of the program code until is reaches the next breakpoint or watchpoint.

Upvotes: 1

Related Questions