Debug with logging