Home Reference Source Test
import {Log} from 'hiplog/src/index.js'
public class | source

Log

Fancy lightweight logging utility.

Test:

Constructor Summary

Public Constructor
public

Creates an instance of Log.

Member Summary

Public Members
public

[level](parts: ...*): undefined: *

Logging method for each level of options.levels.

public get
public

options: *

Method Summary

Public Methods
public

buildBody(parts: *[]): string

Build the body.

public

Build the header.

public

buildMessage(level: number, parts: *[]): string

Build the entire message.

public

write(level: number, parts: *[]): undefined

Build a message and write it to the stream.

Public Constructors

public constructor(options: Log~options): Log source

Creates an instance of Log.

Params:

NameTypeAttributeDescription
options Log~options
  • optional
  • default: {}

Options.

Return:

Log

A new instance of Log.

Public Members

public [level](parts: ...*): undefined: * source

Logging method for each level of options.levels.

Return:

undefined

Nothing.

public get level: number: * source

Properties:

NameTypeAttributeDescription
level number

Integer value of this.options.level.

Return:

number

The level.

Return Properties:

NameTypeAttributeDescription
level number

Integer value of this.options.level.

public options: * source

Public Methods

public buildBody(parts: *[]): string source

Build the body.

Params:

NameTypeAttributeDescription
parts *[]

Parts of the message, not formatted.

Return:

string

The constructed body.

public buildHeader(level: number): string source

Build the header.

Params:

NameTypeAttributeDescription
level number

Level number.

Return:

string

The constructed header.

public buildMessage(level: number, parts: *[]): string source

Build the entire message.

Params:

NameTypeAttributeDescription
level number

Level number.

parts *[]

Parts of the message, not formatted.

Return:

string

The constructed message.

public write(level: number, parts: *[]): undefined source

Build a message and write it to the stream.

Params:

NameTypeAttributeDescription
level number

Level number.

parts *[]

Parts of the message, not formatted.

Return:

undefined

Nothing.