@types/splunk-logging
TypeScript icon, indicating that this package has built-in type declarations

0.11.6 • Public • Published

Installation

npm install --save @types/splunk-logging

Summary

This package contains type definitions for splunk-logging (http://dev.splunk.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/splunk-logging.

import { CoreOptions as RequestOptions } from "request";

export interface Config {
    token: string;
    name?: string | undefined;
    host?: string | undefined;
    maxRetries?: number | undefined;
    path?: string | undefined;
    protocol?: "http" | "https" | undefined;
    port?: number | undefined;
    url?: string | undefined;
    level?: string | undefined;
    batchInterval?: number | undefined;
    maxBatchSize?: number | undefined;
    maxBatchCount?: number | undefined;
}

export interface SendContextMetadata {
    host?: string | undefined;
    index?: string | undefined;
    source?: string | undefined;
    sourcetype?: string | undefined;
    time?: number | undefined; // Milliseconds since epoch, e.g. with Date.now()
}

export interface SendContext {
    message: any;
    severity?: string | undefined;
    metadata?: SendContextMetadata | undefined;
}

export type Callback = (error: Error | undefined, req: any, res: any) => void;
export type EventFormatter = (message: any, severity: string) => any;

export class Logger {
    error: (error: Error, context: SendContext) => void;
    eventFormatter: EventFormatter;
    requestOptions: RequestOptions;
    readonly serializedContextQueue: any[];

    constructor(config: Config);

    flush(callback?: Callback): void;
    send(context: SendContext, callback?: Callback): void;
}

Additional Details

  • Last updated: Thu, 18 Apr 2024 18:35:25 GMT
  • Dependencies: @types/request

Credits

These definitions were written by Alex Brick, and Borui Gu.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/splunk-logging

Weekly Downloads

12,072

Version

0.11.6

License

MIT

Unpacked Size

5.55 kB

Total Files

5

Last publish

Collaborators

  • types