Switched to debug statement which is more efficient regarding stack usage, only printing at debug level 2 or higher.