Print statements are a valid way to debug code
I believe it is perfectly fine to debug your code by littering it with System.out.println
(or whatever print statement works for your language). Often, this can be quicker than debugging, and you can compare printed outputs against other runs of the app.
Just make sure to remove the print statements when you go to production (or better, turn them into logging statements)