MCPcopy Index your code
hub / github.com/eyaltoledano/claude-task-master / log

Function log

scripts/init.js:84–117  ·  view source on GitHub ↗
(level, ...args)

Source from the content-addressed store, hash-verified

82
83// Logging function with icons and colors
84function log(level, ...args) {
85 const icons = {
86 debug: chalk.gray('•'),
87 info: chalk.blue('→'),
88 warn: chalk.yellow('!'),
89 error: chalk.red('✗'),
90 success: chalk.green('✓')
91 };
92
93 if (LOG_LEVELS[level] >= LOG_LEVEL) {
94 const icon = icons[level] || '';
95
96 // Only output to console if not in silent mode
97 if (!isSilentMode()) {
98 if (level === 'error') {
99 console.error(icon, chalk.red(...args));
100 } else if (level === 'warn') {
101 console.warn(icon, chalk.yellow(...args));
102 } else if (level === 'success') {
103 console.log(icon, chalk.green(...args));
104 } else if (level === 'info') {
105 console.log(icon, chalk.blue(...args));
106 } else {
107 console.log(icon, ...args);
108 }
109 }
110 }
111
112 // Write to debug log if DEBUG=true
113 if (process.env.DEBUG === 'true') {
114 const logMessage = `[${level.toUpperCase()}] ${args.join(' ')}\n`;
115 fs.appendFileSync('init-debug.log', logMessage);
116 }
117}
118
119// Function to create directory if it doesn't exist
120function ensureDirectoryExists(dirPath) {

Callers 15

onRemoveRulesProfileFunction · 0.90
kiro.jsFile · 0.90
onAddRulesProfileFunction · 0.90
onRemoveRulesProfileFunction · 0.90
removeDirectoryRecursiveFunction · 0.90
onAddRulesProfileFunction · 0.90
onRemoveRulesProfileFunction · 0.90
createProfileFunction · 0.90

Calls 4

isSilentModeFunction · 0.90
errorMethod · 0.65
warnMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected