Interface AsyncOptions

AsyncOptions
Represents a set of options for configuring the logger service asynchronously.

Example

const asyncOptions: AsyncOptions = {
useFactory: async () => {
return {
discordWebhook: 'https://discord.com/api/webhooks/...',
telegram: { token: '...', chatId: '123456789' },
isGlobal: true
}
},
inject: []
}
interface AsyncOptions {
    discordWebhook?: string;
    file?: {
        fileFormat?: "log" | "txt";
        flags?: string;
        includeDateInFilename?: boolean;
        messageFormat?: "DATE | LEVEL | CONTEXT | MESSAGE" | "DATE - LEVEL | CONTEXT | MESSAGE" | "DATE | CONTEXT | MESSAGE" | "DATE - CONTEXT | MESSAGE" | "DATE | MESSAGE" | "DATE - MESSAGE";
        path: string;
    };
    inject?: any[];
    isGlobal?: boolean;
    sentry?: {
        dsn: string;
        environment: string;
        integrations?: any[];
        tracesSampleRate: number;
    };
    telegram?: {
        chatId: string;
        token: string;
    };
    useFactory?: ((...args) => Options | Promise<Options>);
}

Hierarchy (view full)

Properties

discordWebhook?: string

The Discord webhook URL.

Default

undefined

Example

'https://discord.com/api/webhooks/...'
file?: {
    fileFormat?: "log" | "txt";
    flags?: string;
    includeDateInFilename?: boolean;
    messageFormat?: "DATE | LEVEL | CONTEXT | MESSAGE" | "DATE - LEVEL | CONTEXT | MESSAGE" | "DATE | CONTEXT | MESSAGE" | "DATE - CONTEXT | MESSAGE" | "DATE | MESSAGE" | "DATE - MESSAGE";
    path: string;
}

Options for the file emitter.

Type declaration

  • Optional fileFormat?: "log" | "txt"
  • Optional flags?: string
  • Optional includeDateInFilename?: boolean
  • Optional messageFormat?: "DATE | LEVEL | CONTEXT | MESSAGE" | "DATE - LEVEL | CONTEXT | MESSAGE" | "DATE | CONTEXT | MESSAGE" | "DATE - CONTEXT | MESSAGE" | "DATE | MESSAGE" | "DATE - MESSAGE"
  • path: string

Default

undefined

Example

{ path: './logs', includeDateInFilename: true, fileFormat: 'log', messageFormat: 'DATE - LEVEL | CONTEXT | MESSAGE' }
inject?: any[]

The dependencies to inject into the factory.

isGlobal?: boolean

Whether the module is global.

Default

false
sentry?: {
    dsn: string;
    environment: string;
    integrations?: any[];
    tracesSampleRate: number;
}

Options for Sentry integration.

Type declaration

  • dsn: string
  • environment: string
  • Optional integrations?: any[]
  • tracesSampleRate: number
telegram?: {
    chatId: string;
    token: string;
}

Options for the Telegram bot.

Type declaration

  • chatId: string
  • token: string

Default

undefined

Example

{ token: '..', chatId: '123456789' }
useFactory?: ((...args) => Options | Promise<Options>)

The factory for creating the options.

Type declaration

Generated using TypeDoc