If you want to do it at multiple places, with different logics (logs or just any similar side-effect), you might benefit by adding a peek function in a common utility, as described in the below answer
peek
How to peek on an Optional?