Installation
npm install --save @types/graylog2
Summary
This package contains type definitions for graylog2 (https://github.com/Wizcorp/node-graylog2).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graylog2.
import { EventEmitter } from 'events';
export type GraylogDeflate = 'optimal' | 'always' | 'never';
export type GraylogLogMethod =
| 'log'
| 'emergency'
| 'alert'
| 'critical'
| 'error'
| 'warning'
| 'warn'
| 'notice'
| 'info'
| 'debug';
export interface GraylogConfig {
hostname?: string | undefined;
facility?: string | undefined;
deflate?: GraylogDeflate | undefined;
bufferSize?: number | undefined;
servers: ReadonlyArray<Readonly<{ host: string; port: number }>>;
}
export class graylog extends EventEmitter {
constructor(config: Readonly<GraylogConfig>);
log(message: string | Error | Record<string, any>): void;
log(message: string, fullMessage: string, additionalFields?: Record<string, any>, timestamp?: number): void;
log(message: string | Error, additionalFields?: Record<string, any>, _?: undefined, timestamp?: number): void;
log(
message: string | Error | Record<string, any>,
_: undefined,
additionalFields: Record<string, any> | undefined,
timestamp?: number,
): void;
emergency: graylog['log'];
alert: graylog['log'];
critical: graylog['log'];
error: graylog['log'];
warning: graylog['log'];
warn: graylog['log'];
notice: graylog['log'];
info: graylog['log'];
debug: graylog['log'];
close(callback?: (err: Error | undefined) => void): void;
}
export namespace graylog {
const graylog: graylog;
}
Additional Details
- Last updated: Thu, 16 Dec 2021 22:31:57 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Andrey Kun.