feat: log timestamps in ISO format

This commit is contained in:
Adhiraj Singh
2022-03-24 20:39:05 +05:30
parent 1635b1e756
commit 4b6e97cf93
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import P from 'pino'
import type { CommonSocketConfig, LegacySocketConfig, MediaType, SocketConfig } from '../Types'
import { Browsers } from '../Utils'
import logger from '../Utils/logger'
import { version } from './baileys-version.json'
export const UNAUTHORIZED_CODES = [401, 403, 419]
@@ -25,7 +25,7 @@ const BASE_CONNECTION_CONFIG: CommonSocketConfig<any> = {
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
connectTimeoutMs: 20_000,
keepAliveIntervalMs: 25_000,
logger: P().child({ class: 'baileys' }),
logger: logger.child({ class: 'baileys' }),
printQRInTerminal: false,
emitOwnEvents: true,
defaultQueryTimeoutMs: 60_000,

3
src/Utils/logger.ts Normal file
View File

@@ -0,0 +1,3 @@
import P from 'pino'
export default P({ timestamp: () => `,"time":"${new Date().toJSON()}"` })