mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
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:
committed by
GitHub
parent
447e648958
commit
21f8431e61
@@ -5,6 +5,7 @@ import { DEFAULT_CACHE_TTLS } from '../Defaults'
|
||||
import type { AuthenticationCreds, CacheStore, SignalDataSet, SignalDataTypeMap, SignalKeyStore, SignalKeyStoreWithTransaction, TransactionCapabilityOptions } from '../Types'
|
||||
import { Curve, signedKeyPair } from './crypto'
|
||||
import { delay, generateRegistrationId } from './generics'
|
||||
import { ILogger } from './logger'
|
||||
|
||||
/**
|
||||
* Adds caching capability to a SignalKeyStore
|
||||
@@ -14,7 +15,7 @@ import { delay, generateRegistrationId } from './generics'
|
||||
*/
|
||||
export function makeCacheableSignalKeyStore(
|
||||
store: SignalKeyStore,
|
||||
logger: Logger,
|
||||
logger: ILogger,
|
||||
_cache?: CacheStore
|
||||
): SignalKeyStore {
|
||||
const cache = _cache || new NodeCache({
|
||||
@@ -83,7 +84,7 @@ export function makeCacheableSignalKeyStore(
|
||||
*/
|
||||
export const addTransactionCapability = (
|
||||
state: SignalKeyStore,
|
||||
logger: Logger,
|
||||
logger: ILogger,
|
||||
{ maxCommitRetries, delayBetweenTriesMs }: TransactionCapabilityOptions
|
||||
): SignalKeyStoreWithTransaction => {
|
||||
// number of queries made to the DB during the transaction
|
||||
|
||||
Reference in New Issue
Block a user