1
0
Files
stale/src/classes/loggers/logger.ts
T

29 lines
729 B
TypeScript
Raw Normal View History

import * as core from '@actions/core';
2021-03-08 11:56:52 +01:00
import chalk from 'chalk';
import terminalLink from 'terminal-link';
import {Option} from '../../enums/option';
export class Logger {
2021-03-08 11:56:52 +01:00
warning(...message: string[]): void {
core.warning(chalk.whiteBright(...message));
}
2021-03-08 11:56:52 +01:00
info(...message: string[]): void {
core.info(chalk.whiteBright(...message));
}
2021-03-08 11:56:52 +01:00
error(...message: string[]): void {
core.error(chalk.whiteBright(...message));
}
createLink(name: Readonly<string>, link: Readonly<string>): string {
return terminalLink(name, link);
}
createOptionLink(option: Readonly<Option>): string {
return chalk.magenta(
this.createLink(option, `https://github.com/actions/stale#${option}`)
);
}
}