Debugging is Force.com's way of printing the specified message, in string format, to the execution debug log with the specified log level. Called using System.debug which takes either single parameter of message or two parameters of message and log level.
Debugging is boon to the developers developing in Apex to print out any specified message to the execution debug log.
Types of Debug Statements:
Here the parameter will be of any type which will be converted to String using String.valueOf() internally by Force.com run time engine. Here the log level is DEBUG.
Here the parameters will be of any type along with loglevel.
Valid log levels are (listed from lowest to highest):
Calls to System.debug are not counted as part of Apex code coverage.