@types/bunyan

  • Version 1.8.11
  • Published
  • 10.9 kB
  • 1 dependency
  • MIT license

Install

npm i @types/bunyan
yarn add @types/bunyan
pnpm add @types/bunyan

Overview

TypeScript definitions for bunyan

Index

Variables

variable DEBUG

const DEBUG: number;

    variable ERROR

    const ERROR: number;

      variable FATAL

      const FATAL: number;

        variable INFO

        const INFO: number;

          variable levelFromName

          const levelFromName: {
          trace: number;
          debug: number;
          info: number;
          warn: number;
          error: number;
          fatal: number;
          };

            variable nameFromLevel

            const nameFromLevel: { [level: number]: string };

              variable stdSerializers

              const stdSerializers: StdSerializers;

                variable TRACE

                const TRACE: number;

                  variable WARN

                  const WARN: number;

                    Functions

                    function createLogger

                    createLogger: (options: LoggerOptions) => Logger;

                      function resolveLevel

                      resolveLevel: (value: LogLevel) => number;

                        function safeCycles

                        safeCycles: () => (key: string, value: any) => any;

                          Classes

                          class Logger

                          class Logger extends EventEmitter {}

                            constructor

                            constructor(options: Logger.LoggerOptions);

                              property fields

                              fields: any;

                                property src

                                src: boolean;

                                  method addSerializers

                                  addSerializers: (serializers: Logger.Serializers) => void;

                                    method addStream

                                    addStream: (stream: Logger.Stream) => void;

                                      method child

                                      child: (options: Object, simple?: boolean) => Logger;

                                        method debug

                                        debug: {
                                        (): boolean;
                                        (error: Error, ...params: any[]): void;
                                        (obj: Object, ...params: any[]): void;
                                        (format: any, ...params: any[]): void;
                                        };
                                        • Returns a boolean: is the debug level enabled?

                                          This is equivalent to log.isDebugEnabled() or log.isEnabledFor(DEBUG) in log4j.

                                        • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                        • The first field can optionally be a "fields" object, which is merged into the log record.

                                          To pass in an Error *and* other fields, use the err field name for the Error instance.

                                        • Uses util.format for msg formatting.

                                        method error

                                        error: {
                                        (): boolean;
                                        (error: Error, ...params: any[]): void;
                                        (obj: Object, ...params: any[]): void;
                                        (format: any, ...params: any[]): void;
                                        };
                                        • Returns a boolean: is the error level enabled?

                                          This is equivalent to log.isErrorEnabled() or log.isEnabledFor(ERROR) in log4j.

                                        • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                        • The first field can optionally be a "fields" object, which is merged into the log record.

                                          To pass in an Error *and* other fields, use the err field name for the Error instance.

                                        • Uses util.format for msg formatting.

                                        method fatal

                                        fatal: {
                                        (): boolean;
                                        (error: Error, ...params: any[]): void;
                                        (obj: Object, ...params: any[]): void;
                                        (format: any, ...params: any[]): void;
                                        };
                                        • Returns a boolean: is the fatal level enabled?

                                          This is equivalent to log.isFatalEnabled() or log.isEnabledFor(FATAL) in log4j.

                                        • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                        • The first field can optionally be a "fields" object, which is merged into the log record.

                                          To pass in an Error *and* other fields, use the err field name for the Error instance.

                                        • Uses util.format for msg formatting.

                                        method info

                                        info: {
                                        (): boolean;
                                        (error: Error, ...params: any[]): void;
                                        (obj: Object, ...params: any[]): void;
                                        (format: any, ...params: any[]): void;
                                        };
                                        • Returns a boolean: is the info level enabled?

                                          This is equivalent to log.isInfoEnabled() or log.isEnabledFor(INFO) in log4j.

                                        • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                        • The first field can optionally be a "fields" object, which is merged into the log record.

                                          To pass in an Error *and* other fields, use the err field name for the Error instance.

                                        • Uses util.format for msg formatting.

                                        method level

                                        level: { (): number; (value: Logger.LogLevel): void };

                                          method levels

                                          levels: {
                                          (): number[];
                                          (name: string | number): number;
                                          (name: string | number, value: Logger.LogLevel): void;
                                          };

                                            method reopenFileStreams

                                            reopenFileStreams: () => void;

                                              method trace

                                              trace: {
                                              (): boolean;
                                              (error: Error, ...params: any[]): void;
                                              (obj: Object, ...params: any[]): void;
                                              (format: any, ...params: any[]): void;
                                              };
                                              • Returns a boolean: is the trace level enabled?

                                                This is equivalent to log.isTraceEnabled() or log.isEnabledFor(TRACE) in log4j.

                                              • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                              • The first field can optionally be a "fields" object, which is merged into the log record.

                                                To pass in an Error *and* other fields, use the err field name for the Error instance.

                                              • Uses util.format for msg formatting.

                                              method warn

                                              warn: {
                                              (): boolean;
                                              (error: Error, ...params: any[]): void;
                                              (obj: Object, ...params: any[]): void;
                                              (format: any, ...params: any[]): void;
                                              };
                                              • Returns a boolean: is the warn level enabled?

                                                This is equivalent to log.isWarnEnabled() or log.isEnabledFor(WARN) in log4j.

                                              • Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

                                              • The first field can optionally be a "fields" object, which is merged into the log record.

                                                To pass in an Error *and* other fields, use the err field name for the Error instance.

                                              • Uses util.format for msg formatting.

                                              class RingBuffer

                                              class RingBuffer extends EventEmitter {}

                                                constructor

                                                constructor(options: RingBufferOptions);

                                                  property records

                                                  records: any[];

                                                    property writable

                                                    writable: boolean;

                                                      method destroy

                                                      destroy: () => void;

                                                        method destroySoon

                                                        destroySoon: () => void;

                                                          method end

                                                          end: (record?: any) => void;

                                                            method write

                                                            write: (record: any) => boolean;

                                                              class RotatingFileStream

                                                              class RotatingFileStream extends EventEmitter {}

                                                                constructor

                                                                constructor(options: RotatingFileStreamOptions);

                                                                  property periodNum

                                                                  periodNum: number;

                                                                    property periodScope

                                                                    periodScope: string;

                                                                      property rotating

                                                                      rotating: boolean;

                                                                        property rotQueue

                                                                        rotQueue: any[];

                                                                          property stream

                                                                          stream: any;

                                                                            property writable

                                                                            writable: boolean;

                                                                              method destroy

                                                                              destroy: () => void;

                                                                                method destroySoon

                                                                                destroySoon: () => void;

                                                                                  method end

                                                                                  end: (record?: any) => void;

                                                                                    method rotate

                                                                                    rotate: () => void;

                                                                                      method write

                                                                                      write: (record: any) => boolean;

                                                                                        Interfaces

                                                                                        interface LoggerOptions

                                                                                        interface LoggerOptions {}

                                                                                          property level

                                                                                          level?: LogLevel | undefined;

                                                                                            property name

                                                                                            name: string;

                                                                                              property serializers

                                                                                              serializers?: Serializers | undefined;

                                                                                                property src

                                                                                                src?: boolean | undefined;

                                                                                                  property stream

                                                                                                  stream?: NodeJS.WritableStream | undefined;

                                                                                                    property streams

                                                                                                    streams?: Stream[] | undefined;

                                                                                                      index signature

                                                                                                      [custom: string]: any;

                                                                                                        interface RingBufferOptions

                                                                                                        interface RingBufferOptions {}

                                                                                                          property limit

                                                                                                          limit?: number | undefined;

                                                                                                            interface RotatingFileStreamOptions

                                                                                                            interface RotatingFileStreamOptions {}

                                                                                                              property count

                                                                                                              count?: number | undefined;

                                                                                                                property path

                                                                                                                path: string;

                                                                                                                  property period

                                                                                                                  period?: string | undefined;

                                                                                                                    interface Serializers

                                                                                                                    interface Serializers {}

                                                                                                                      index signature

                                                                                                                      [key: string]: Serializer;

                                                                                                                        interface StdSerializers

                                                                                                                        interface StdSerializers extends Serializers {}

                                                                                                                          property err

                                                                                                                          err: Serializer;

                                                                                                                            property req

                                                                                                                            req: Serializer;

                                                                                                                              property res

                                                                                                                              res: Serializer;

                                                                                                                                interface Stream

                                                                                                                                interface Stream {}

                                                                                                                                  property closeOnExit

                                                                                                                                  closeOnExit?: boolean | undefined;

                                                                                                                                    property count

                                                                                                                                    count?: number | undefined;

                                                                                                                                      property level

                                                                                                                                      level?: LogLevel | undefined;

                                                                                                                                        property name

                                                                                                                                        name?: string | undefined;

                                                                                                                                          property path

                                                                                                                                          path?: string | undefined;

                                                                                                                                            property period

                                                                                                                                            period?: string | undefined;

                                                                                                                                              property reemitErrorEvents

                                                                                                                                              reemitErrorEvents?: boolean | undefined;

                                                                                                                                                property stream

                                                                                                                                                stream?: NodeJS.WritableStream | WriteFn | undefined;

                                                                                                                                                  property type

                                                                                                                                                  type?: string | undefined;

                                                                                                                                                    interface WriteFn

                                                                                                                                                    interface WriteFn {}

                                                                                                                                                      property write

                                                                                                                                                      write: (object: Object) => void;

                                                                                                                                                        Type Aliases

                                                                                                                                                        type LogLevel

                                                                                                                                                        type LogLevel = LogLevelString | number;

                                                                                                                                                          type LogLevelString

                                                                                                                                                          type LogLevelString = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';

                                                                                                                                                            type Serializer

                                                                                                                                                            type Serializer = (input: any) => any;

                                                                                                                                                              Package Files (1)

                                                                                                                                                              Dependencies (1)

                                                                                                                                                              Dev Dependencies (0)

                                                                                                                                                              No dev dependencies.

                                                                                                                                                              Peer Dependencies (0)

                                                                                                                                                              No peer dependencies.

                                                                                                                                                              Badge

                                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/bunyan.

                                                                                                                                                              • Markdown
                                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/bunyan)
                                                                                                                                                              • HTML
                                                                                                                                                                <a href="https://www.jsdocs.io/package/@types/bunyan"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>