Added debug logging capability.