I make a method called logger.debug,
logger.info, etc etc. It drip-drops lines into a filecabinet file. At the end of all my scirpts, I call a scheduled script that will harvest up that file and upload them to a nicer logging service (like kibana or some other logging-as-a-service)