UNPKG

@mcph/bunyan-raven

Version:

A bunyan-compatible stream interface that sends error logs to raven-node.

30 lines (29 loc) 731 B
/// <reference types="node" /> import { Writable } from 'stream'; import { Client } from 'raven'; export interface BunyanLogRecord { level: number; err?: Error | ErrorLike; msg: string; name: string; hostname: string; pid: number; tags?: { [key: string]: string; }; user?: { name?: string; email?: string; id?: number | string; }; } export interface ErrorLike extends Error { code: number; signal: number; } export declare class RavenStream extends Writable { private client; constructor(client: Client); _write(record: BunyanLogRecord, _encoding: string, callback: (err?: Error) => void): void; private gatherRavenMetaData(record); }