feat!: big feature changes

BREAKING CHANGES:
- Heartbeating removed
- `config.consoleLogLevel` -> `config.logLevel`

NEW FEATURES:
- Training messages
- Sequence number system
- WebSocket close codes used instead of disconnect packets

FIXES:
- Improved error handling
- Some performance improvements
- Made code more clean
- Updated dependencies
This commit is contained in:
PalmDevs
2024-03-28 21:41:59 +07:00
parent 77f1a9cb3e
commit b3b7723b4f
33 changed files with 562 additions and 506 deletions

View File

@@ -1,5 +1,5 @@
import { Chalk, supportsColor, supportsColorStderr } from 'chalk'
import { console as uncoloredConsole, Tracer, colorConsole } from 'tracer'
import { type Tracer, colorConsole, console as uncoloredConsole } from 'tracer'
const chalk = new Chalk()
const DefaultConfig = {
@@ -8,19 +8,16 @@ const DefaultConfig = {
'{{message}}',
{
error: `${chalk.bgRedBright.whiteBright(' ERROR ')} {{message}}\n${chalk.gray('{{stack}}')}`,
debug: chalk.gray('DEBUG: {{message}}\n{{stack}}'),
warn: `${chalk.bgYellowBright.whiteBright(' WARN ')} ${chalk.yellowBright('{{message}}')}\n${chalk.gray(
'{{stack}}',
)}`,
debug: chalk.gray('DEBUG: {{message}}'),
warn: `${chalk.bgYellowBright.whiteBright(' WARN ')} ${chalk.yellowBright('{{message}}')}`,
info: `${chalk.bgBlueBright.whiteBright(' INFO ')} ${chalk.cyanBright('{{message}}')}`,
fatal: `${chalk.bgRedBright.whiteBright(' FATAL ')} ${chalk.redBright('{{message}}')}\n${chalk.white(
'{{stack}}',
)}`,
log: '{{message}}',
trace: chalk.gray('[{{timestamp}}] TRACE: {{message}}\n{{stack}}'),
},
],
methods: ['debug', 'trace', 'log', 'info', 'warn', 'error', 'fatal'],
methods: ['debug', 'log', 'info', 'warn', 'error', 'fatal'],
filters: [],
} satisfies Tracer.LoggerConfig