feat(logger): add [BAILEYS] console-friendly logging functions
Add formatted logging functions with [BAILEYS] prefix and emojis: - logEventBuffer: buffer events (📦, 🔄, ⚠️, ⏰, 🧹, 🧠) - logBufferMetrics: metrics display (📊) - logMessageSent/Received: message events (📤, 📥) - logConnection: connection events (🔌, ✅, 🔴, 🔄, ❌) - logAuth: authentication events (📱, 🔑, 🚪, 🔐) - logCircuitBreaker: circuit breaker state (⚡, ✅, 🔶) - logRetry: retry attempts (🔁) - logInfo/Warn/Error: generic messages (ℹ️, ⚠️, ❌) - logLidMapping: LID store events (🗂️, 🔍, 💾, 📦) All functions respect BAILEYS_LOG=false environment variable. Integrated into event-buffer.ts and messages-send/recv.ts.
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
WAMessage,
|
||||
WAMessageKey
|
||||
} from '../Types'
|
||||
import { logMessageSent } from '../Utils/baileys-logger'
|
||||
import {
|
||||
aggregateMessageKeysNotFromMe,
|
||||
assertMediaContent,
|
||||
@@ -1034,6 +1035,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
|
||||
await sendNode(stanza)
|
||||
|
||||
// Log with [BAILEYS] prefix
|
||||
logMessageSent(msgId, destinationJid)
|
||||
|
||||
// Add message to retry cache if enabled
|
||||
if (messageRetryManager && !participant) {
|
||||
messageRetryManager.addRecentMessage(destinationJid, msgId, message)
|
||||
|
||||
Reference in New Issue
Block a user