review-copilot
Version:
ReviewCopilot - AI-powered code review assistant with customizable prompts
56 lines (55 loc) • 1.88 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logger = void 0;
const chalk_1 = __importDefault(require("chalk"));
/**
* Logger utility class for consistent console output with styling
*/
class Logger {
static divider(char = '─', length = 50, color = 'green') {
console.log(chalk_1.default[color]('\n' + char.repeat(length)));
}
static info(message) {
console.log(chalk_1.default.blue(message));
}
static success(message) {
console.log(chalk_1.default.green(message));
}
static warning(message) {
console.log(chalk_1.default.yellow(message));
}
static error(message) {
console.log(chalk_1.default.red(message));
}
static gray(message) {
console.log(chalk_1.default.gray(message));
}
static white(message) {
console.log(chalk_1.default.white(message));
}
static cyan(message) {
console.log(chalk_1.default.cyan(message));
}
static yellow(message) {
console.log(chalk_1.default.yellow(message));
}
static commitInfo(commit, index) {
this.divider();
this.yellow(`📝 Commit ${index + 1}: ${commit.hash.slice(0, 7)}`);
this.cyan(`👤 Author: ${commit.author}`);
this.cyan(`📅 Date: ${commit.date}`);
this.white(`💬 Message: ${commit.message}`);
}
static prInfo(info) {
this.divider('=', 60);
this.info('📁 Reviewing PR Code Changes:');
this.yellow(`📋 PR Title: ${info.message}`);
this.yellow(`🔍 Head Commit: ${info.hash}`);
this.cyan(`👤 Author: ${info.author}`);
this.cyan(`📅 Last Updated: ${info.date}`);
}
}
exports.Logger = Logger;