-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.js
38 lines (33 loc) · 1.5 KB
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import CFonts from 'cfonts';
import chalk from 'chalk';
import Table from 'cli-table3';
const logHeader = (title, options = {}) => {
const cFontsOptions = {
font: 'block', // define the font face
align: 'left', // define text alignment
colors: ['blue'], // define all colors
background: 'transparent', // define the background color, you can also use `backgroundColor` here as key
// letterSpacing: 1, // define letter spacing
// lineHeight: 1, // define the line height
// space: true, // define if the output text should have empty lines on top and on the bottom
// maxLength: '0', // define how many character can be on one line
// gradient: false, // define your two gradient colors
// independentGradient: false, // define if you want to recalculate the gradient for each new line
// transitionGradient: false, // define if this is a transition between colors directly
// env: 'node' // define the environment CFonts is being executed in
...options,
};
CFonts.say(title, cFontsOptions);
};
const logInfo = (message, options = {}) => {
console.log(chalk.bgBlueBright.white(message));
};
const logTables = (keys, teamsValues) => {
const table = new Table({
head: keys,
colWidths: [25],
});
table.push(...teamsValues);
console.log(table.toString());
};
export { logHeader, logInfo, logTables };