refactored logInfo method