UNPKG

@defikitdotnet/x-ai-combat

Version:

XCombatAI - Social Media Engagement Template for the Agent Framework

66 lines 1.8 kB
"use strict"; /** * X-AI-Combat Logger Utility * * Provides logging utilities with consistent formatting */ Object.defineProperty(exports, "__esModule", { value: true }); exports.warn = exports.error = exports.log = void 0; /** * Log a message with X-AI-COMBAT prefix */ const log = (...args) => { if (args.length === 0) { console.log('[X-AI-COMBAT]'); return; } const firstArg = args[0]; if (typeof firstArg === 'string') { // For string first arguments, prefix the string console.log(`[X-AI-COMBAT] ${firstArg}`, ...args.slice(1)); } else { // For non-string first arguments (objects, etc.) console.log('[X-AI-COMBAT]', ...args); } }; exports.log = log; /** * Log an error with X-AI-COMBAT prefix */ const error = (...args) => { if (args.length === 0) { console.error('[X-AI-COMBAT]'); return; } const firstArg = args[0]; if (typeof firstArg === 'string') { // For string first arguments, prefix the string console.log(`[X-AI-COMBAT] ${firstArg}`, ...args.slice(1)); } else { // For non-string first arguments (objects, etc.) console.log('[X-AI-COMBAT]', ...args); } }; exports.error = error; /** * Log a warning with X-AI-COMBAT prefix */ const warn = (...args) => { if (args.length === 0) { console.warn('[X-AI-COMBAT]'); return; } const firstArg = args[0]; if (typeof firstArg === 'string') { // For string first arguments, prefix the string console.warn(`[X-AI-COMBAT] ${firstArg}`, ...args.slice(1)); } else { // For non-string first arguments (objects, etc.) console.warn('[X-AI-COMBAT]', ...args); } }; exports.warn = warn; //# sourceMappingURL=logger.js.map