Updated code to handle printing to logs. Added info log.