LogMessageBuilder

log~ LogMessageBuilder

Provides a convenient way for logging things.

Constructor

new LogMessageBuilder() → {LogMessageBuilder}

Source:
Returns:
Type:
LogMessageBuilder

for chaining

Members

(private, static) this._from :string

The source of the message

Source:
Type:
  • string

(private, static) this._text :string

The text of the message

Source:
Type:
  • string

(private, static) this._type :string

The type of the message

Source:
Type:
  • string

Methods

(private) _log()

Logs the message.

Source:

e(t) → {LogMessageBuilder}

Convenience method for logging errors. Sets the type to types.error and also the text of the message.

Source:
Parameters:
Name Type Description
t string | Error

the text of the message. If passed an Error, the message property of the error will be used

Returns:
Type:
LogMessageBuilder

for chaining

from(f) → {LogMessageBuilder}

Sets the source of the message

Source:
Parameters:
Name Type Description
f string

the source of the message

Returns:
Type:
LogMessageBuilder

for chaining

i(t) → {LogMessageBuilder}

Convenience method for logging information. Sets the type to types.message and also the text of the message.

Source:
Parameters:
Name Type Description
t string | Error

the text of the message. If passed an Error, the message property of the error will be used

Returns:
Type:
LogMessageBuilder

for chaining

now() → {LogMessageBuilder}

Logs the message now.

Source:
Returns:
Type:
LogMessageBuilder

for chaining

r(t) → {LogMessageBuilder}

Convenience method for logging responses. Sets the type to types.response and also the text of the message.

Source:
Parameters:
Name Type Description
t string | Error

the text of the message. If passed an Error, the message property of the error will be used

Returns:
Type:
LogMessageBuilder

for chaining

text(t) → {LogMessageBuilder}

Sets the text of the message

Source:
Parameters:
Name Type Description
t string | Error

the text of the message. If passed an Error, the message property of the error will be used

Returns:
Type:
LogMessageBuilder

for chaining

type(t) → {LogMessageBuilder}

Sets the type of the message

Source:
Parameters:
Name Type Description
t string

the type of the message

Returns:
Type:
LogMessageBuilder

for chaining

w(t) → {LogMessageBuilder}

Convenience method for logging warnings. Sets the type to types.warning and also the text of the message.

Source:
Parameters:
Name Type Description
t string | Error

the text of the message. If passed an Error, the message property of the error will be used

Returns:
Type:
LogMessageBuilder

for chaining