Write to Log

Logging is important for recording parts of your python’s execution and for debugging purposes. For Python, it’s recommended that you use the logging standard library which is redirected to Carbonite SDK. The advantage with this method is that it follows Python standard practice and it also captures file path and location.

logging Library

import logging
logger = logging.getLogger(__name__)
logger.info("123")
logger.warning("456")
logger.error("789")

carb Library

While logging is recommended, there are also bindings for logging with carb and you may find some extensions using that.

# Carbonite logger can used both for Python and C++:
import carb
carb.log_info("123")
carb.log_warn("456")
carb.log_error("789")