@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
Functions
Classes
Interfaces
Type Aliases
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()
orlog.isEnabledFor(DEBUG)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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()
orlog.isEnabledFor(ERROR)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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()
orlog.isEnabledFor(FATAL)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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()
orlog.isEnabledFor(INFO)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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()
orlog.isEnabledFor(TRACE)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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()
orlog.isEnabledFor(WARN)
in log4j.Special case to log an
Error
instance to the record. This adds anerr
field with exception details (including the stack) and setsmsg
to the exception message or you can specify themsg
.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 {}
interface Serializers
interface Serializers {}
index signature
[key: string]: Serializer;
interface StdSerializers
interface StdSerializers extends Serializers {}
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;
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 oneto 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>
- Updated .
Package analyzed in 3308 ms. - Missing or incorrect documentation? Open an issue for this package.