Debian Codegraph @

cli/tools-cli/src/scripts/log.ts

raw symbols SCIP
1 import chalk from "chalk";
2
3 // An enum representing the log level and the color to use
4 // in chalk to render this level.
5 // eslint-disable-next-line no-shadow
6 export enum Level {
7 INFO = "blue",
8 ERROR = "red",
9 SUCCESS = "green",
10 }
11
12 /**
13 * Log a message in the console. Can specify a Level, which
14 * will be INFO by default.
15 *
16 * @param message The message to log
17 * @param level The level to log
18 */
19 export default abstract class SpecLogger {
20 static log(message: string, level: Level = Level.INFO): void {
21 console.log(chalk[level](message));
22 }
23 }