Added logging using logging module.