Dependency Inversion for Logger (#1153)

* feat: interface "ILogger" created
feat: interface "ILogger" used instead of pino logger
feat: "PinoLoggerAdapter" created to implement "ILogger" interface

* feat: PinoLoggerAdapter removed
feat: ILogger mapping the features we're using from pino

* fix: sort imports

---------

Co-authored-by: Mateus Franchini de Freitas <contato.mateusfr@outlook.com>
Co-authored-by: Mateus Franchini de Freitas <mfranchini@domtec.com.br>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
contato.mateusfr@gmail.com
2025-03-01 13:30:51 -03:00
committed by GitHub
parent 447e648958
commit 21f8431e61
15 changed files with 47 additions and 36 deletions

View File

@@ -866,7 +866,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
if(placeholderResendCache.get(messageKey?.id!)) {
logger.debug('already requested resend', { messageKey })
logger.debug({ messageKey }, 'already requested resend')
return
} else {
placeholderResendCache.set(messageKey?.id!, true)
@@ -875,7 +875,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
await delay(5000)
if(!placeholderResendCache.get(messageKey?.id!)) {
logger.debug('message received while resend requested', { messageKey })
logger.debug({ messageKey }, 'message received while resend requested')
return 'RESOLVED'
}
@@ -888,7 +888,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
setTimeout(() => {
if(placeholderResendCache.get(messageKey?.id!)) {
logger.debug('PDO message without response after 15 seconds. Phone possibly offline', { messageKey })
logger.debug({ messageKey }, 'PDO message without response after 15 seconds. Phone possibly offline')
placeholderResendCache.del(messageKey?.id!)
}
}, 15_000)