fix(services): Improve logging and enhance MongoDB Compass integration
Some checks failed
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped

This commit is contained in:
2025-08-15 09:37:54 +00:00
parent 05b170cbac
commit 7b9ebfdacb
7 changed files with 160 additions and 163 deletions

View File

@@ -1,5 +1,6 @@
import * as plugins from './mod.plugins.js';
import * as net from 'net';
import { logger } from '../gitzone.logging.js';
/**
* Check if a port is available
@@ -58,40 +59,14 @@ export const getProjectName = (): string => {
return plugins.path.basename(process.cwd());
};
/**
* Print colored message to console
*/
export const printMessage = (message: string, color?: 'green' | 'yellow' | 'red' | 'blue' | 'magenta' | 'cyan') => {
const logger = new plugins.smartlog.ConsoleLog();
switch (color) {
case 'green':
logger.log('ok', message);
break;
case 'yellow':
logger.log('note', message);
break;
case 'red':
logger.log('error', message);
break;
case 'blue':
case 'magenta':
case 'cyan':
logger.log('info', message);
break;
default:
logger.log('info', message);
}
};
/**
* Print a header with decorative lines
*/
export const printHeader = (title: string) => {
console.log();
printMessage('═══════════════════════════════════════════════════════════════', 'cyan');
printMessage(` ${title}`, 'cyan');
printMessage('═══════════════════════════════════════════════════════════════', 'cyan');
logger.log('info', '═══════════════════════════════════════════════════════════════');
logger.log('info', ` ${title}`);
logger.log('info', '═══════════════════════════════════════════════════════════════');
console.log();
};