import { AsyncModuleConfig } from '@golevelup/nestjs-modules' ; import { DynamicModule , Module , Provider } from '@nestjs/common' ; import { OgmaModuleOptions , Type } from './interfaces' ; import { createLoggerProviders , createRequestScopedLoggerProviders } from './ogma.provider' ; import { OgmaCoreModule } from './ogma-core.module' ; import { OgmaProviderOptions } from './interfaces/ogma-provider-options.interface' ; /**
 * The NestJS module for the Ogma Logger. Not much to say here
 */ @ Module ( { } ) export class OgmaModule { param options returns static forRoot ( options ? ) { return OgmaCoreModule . forRoot ( OgmaCoreModule , options || { } ) ; } param options returns see https static forRootAsync ( options ) { return OgmaCoreModule . forRootAsync ( OgmaCoreModule , options ) ; } param context param options param options . addRequestId static forFeature ( context , options = { addRequestId : false } ) { const providers = this . createProviders ( context , options ) ; return { imports : [ OgmaCoreModule ] , module : OgmaModule , providers , exports : providers , } ; } /**
     * Creates several new OgmaServices based on the given contexts and possible options.
     * Original options from the `forRoot` or `forRootAsync` options are merged with new options
     */ static forFeatures ( contexts ) { const providers = contexts . map ( ( ctx ) => { if ( typeof ctx === 'object' ) { return this . createProviders ( ctx . context , ctx . options ) [ 0 ] ; } return this . createProviders ( ctx ) [ 0 ] ; } ) ; return { module : OgmaModule , imports : [ OgmaCoreModule ] , providers , exports : providers , } ; } private static createProviders ( context , options = { addRequestId : false } ) { if ( options . addRequestId ) { return createRequestScopedLoggerProviders ( context ) ; } return createLoggerProviders ( context ) ; } }