2020-11-25 06:39:35 +03:00
|
|
|
const getTimestamp = () => {
|
2021-06-11 22:25:58 +03:00
|
|
|
return new Date().toISOString().replace(/T/, " ").replace(/\..+/, "");
|
2020-11-25 06:39:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
const getTime = () => {
|
|
|
|
return `[ \x1b[35m\x1b[5m${getTimestamp()}\x1b[0m ]`;
|
|
|
|
};
|
|
|
|
|
|
|
|
const SLATE = "SLATE ";
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
export const error = (...message) => {
|
2021-07-31 01:00:06 +03:00
|
|
|
console.error(`\x1b[1m[ \x1b[31m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
|
2020-11-25 06:39:35 +03:00
|
|
|
};
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
export const log = (...message) => {
|
2021-07-31 01:00:06 +03:00
|
|
|
console.info(`\x1b[1m[ \x1b[32m${SLATE}\x1b[0m\x1b[1m ]\x1b[0m ${getTime()} `, ...message);
|
2020-11-25 06:39:35 +03:00
|
|
|
};
|