Added logging support for neater output.