Replaced puts by $log. Added host option.