feat: Added version in logs

This commit is contained in:
Davidson Gomes 2023-08-07 19:46:34 -03:00
parent ad819bf3ba
commit da568e4ea5

View File

@ -1,6 +1,8 @@
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import fs from 'fs';
import { configService, Log } from './env.config'; import { configService, Log } from './env.config';
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const formatDateLog = (timestamp: number) => const formatDateLog = (timestamp: number) =>
dayjs(timestamp) dayjs(timestamp)
@ -73,6 +75,7 @@ export class Logger {
console.log( console.log(
/*Command.UNDERSCORE +*/ Command.BRIGHT + Level[type], /*Command.UNDERSCORE +*/ Command.BRIGHT + Level[type],
'[Evolution API]', '[Evolution API]',
`v${packageJson.version}`,
Command.BRIGHT + Color[type], Command.BRIGHT + Color[type],
process.pid.toString(), process.pid.toString(),
Command.RESET, Command.RESET,