agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
39 lines (37 loc) • 1.72 kB
JavaScript
/**
* @file Log success message
* @description Single responsibility: Display success information with consistent formatting
*
* This utility provides a standardized way to display success messages across the entire
* AgentSqripts platform. The design ensures visual consistency and helps developers
* distinguish success messages from warnings or errors in console output.
*
* Design rationale:
* - Uses green checkmark emoji for immediate visual recognition
* - Consistent with established CLI patterns for success feedback
* - Separate from console.warn/console.error to maintain semantic meaning
* - Single responsibility keeps this function focused and testable
*/
/**
* Log success message with standardized formatting
*
* Technical function: Outputs a success message to console with green checkmark prefix
*
* Implementation rationale:
* - Uses console.log instead of console.info to ensure visibility in all environments
* - Checkmark emoji provides immediate visual feedback for successful operations
* - Template literal format allows for consistent spacing and readability
* - No color codes used (relies on emoji) to avoid terminal compatibility issues
*
* Alternative approaches considered:
* - Using chalk/colors library: Rejected to avoid additional dependencies
* - Using console.info: Rejected as some environments suppress info logs
* - Custom formatting function: Rejected as too complex for simple success messages
*
* @param {string} message - Human-readable success message to display
* @throws {TypeError} Implicitly throws if message is not string-convertible
*/
function logSuccess(message) {
console.log(`✅ ${message}`);
}
module.exports = logSuccess;