You need to sign in to do that
Don't have an account?
rzs
Logging to the console in Force.com IDE
Hello,
Im using the Force.com IDE for writing Apex code. Is there any way to write debug statements to print a value to the console ?. An example would be really appreciated.
Thank You
use the system.debug method in your code.
for example:
would print this text when you get to that point in the execution.
The method takes a string, so you can actually include most any data that will display in text format.
I have had a lot of success even putting an object and it will print out the text version of the object (field name and value pairs).
All Answers
use the system.debug method in your code.
for example:
would print this text when you get to that point in the execution.
The method takes a string, so you can actually include most any data that will display in text format.
I have had a lot of success even putting an object and it will print out the text version of the object (field name and value pairs).
Thanks for the reply Jim. I created an Apex trigger in the Force.com IDE , which contains the following code:
Now, i update an Opportunity in my developer organization. But i dont see any log after going to Setup->Monitoring->Debug Logs,even though i have added my account as a user to the Debug Logs.
Also,how to see the log within Force.com IDE itself ?
Please help.
Thank You
Its working now..thanks ! :)
What did you do?
Would also like to know what you did. Thanks!
If you are primarilly doing Apex developement, I would recommend trying the developer console. Just click on you name in the header, and then click "Developer Console." When it is open, logs will be generated without having to set a user in Monitoring.
One tip, if the debug statements aren't showing in the log, check the log levels (Apex should be atleast 'DEBUG').