2021-01-16 15:49:50 +01:00
|
|
|
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';
|
2021-01-16 15:49:50 +01:00
|
|
|
|
|
|
|
|
export class Logger {
|
2021-03-08 11:56:52 +01:00
|
|
|
warning(...message: string[]): void {
|
|
|
|
|
core.warning(chalk.whiteBright(...message));
|
2021-01-16 15:49:50 +01:00
|
|
|
}
|
|
|
|
|
|
2021-03-08 11:56:52 +01:00
|
|
|
info(...message: string[]): void {
|
|
|
|
|
core.info(chalk.whiteBright(...message));
|
2021-01-16 15:49:50 +01:00
|
|
|
}
|
|
|
|
|
|
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}`)
|
|
|
|
|
);
|
2021-01-16 15:49:50 +01:00
|
|
|
}
|
|
|
|
|
}
|