sculptui-vscode
Version:
Visually edit your React component code from the browser
37 lines (28 loc) • 872 B
text/typescript
import { window, OutputChannel } from 'vscode';
import chalk from 'chalk';
let outputChannel: OutputChannel | undefined = undefined;
export function log(message: string, line: boolean = true) {
if (!outputChannel) {
outputChannel = window.createOutputChannel('SculptUI');
}
if (line) {
outputChannel.appendLine(message);
} else {
outputChannel.append(message);
}
}
export function logNoNewLine(message: string) {
log(message, false);
}
export function logError(message: string) {
log(chalk.red('error') + ` ${message}`);
}
export function logInfo(message: string) {
log(chalk.blue('info') + ` ${message}`);
}
export function logWarning(message: string) {
log(chalk.yellow('warning') + ` ${message}`);
}
export function logSuccess(message: string) {
log(chalk.green('success') + ` ${message}`);
}