added switch statements to log method