No matter what you are doing, getting logged information for debugging or just knowing what's happening is extremely important. In FTC, the way you do that is through telemetry.
Getting Access to telemetry
Like hardwareMap, the telemetry variable is a field of any class that extends OpMode or LinearOpMode. In other words, the telemetry object can be accessed from any OpMode you create.
Sending Telemetry
Telemetry can be sent to the driver hub by calling one of two methods on the telemetry object.
The first method, telemetry.addData, takes in two parameters: the label and the value. It displays a line with the format of label : value.
telemetry.addData("Test Number", 1);
The second method, telemetry.addLine, takes in one parameter and displays it as a line on the driver hub.
telemetry.addLine("Example Line");
Updating Telemetry
Telemetry will not be updated unless you explicitly call telemetry.update() in your code. If you do not do this, your telemetry will not be sent to the driver hub and will not be displayed. By default, the update method will clear the telemetry on the screen. This can be changed with setAutoClear(). In non-linear opmodes, telemetry is automatically updated at the end of the loop method.