Extends base Airgram logger.
npm install airgram-debug
Basic usage with TypeScript:
import { ag, TYPES } from 'airgram'
import { getCalleeName } from 'airgram/helpers'
import DebugLogger from 'airgram-debug'
airgram.bind<ag.Logger & { level: string }>(TYPES.Logger).to(DebugLogger)
.onActivation((context, logger) => {
logger.namespace = [getCalleeName(context)]
logger.level = 'verbose'
return logger
})
Basic usage with JavaScript:
const {Airgram, AuthDialog, TYPES} = require('airgram')
const {getCalleeName} = require('airgram/helpers')
const DebugLogger = require('airgram-debug')
airgram.bind(TYPES.Logger).to(DebugLogger).onActivation((context, logger) => {
logger.namespace = [getCalleeName(context)]
logger.level = 'verbose'
return logger
})