Logger

Logger

Displays text to the console. Also supports sentry

Constructor

new Logger(optionsopt)

Properties:
Name Type Description
raven RavenClient

The Raven client used for sentry, if enabled.

Creates a new Logger

Parameters:
Name Type Attributes Description
options Object <optional>

The configuration for the logger

Properties
Name Type Attributes Default Description
timestamps Boolean <optional>
false

Add a timestamp to each message logged

levels Object <optional>

An object deciding what log levels should display

Properties
Name Type Attributes Default Description
log Boolean <optional>
true

Show log()

info Boolean <optional>
true

Show info()

debug Boolean <optional>
false

Show debug()

warning Boolean <optional>
true

Show warn()

error Boolean <optional>
true

Show error()

raven Object <optional>

Raven options. If falsy, raven will not be required.

Properties
Name Type Attributes Default Description
url String

Your project's sentry.io url

config Object <optional>

A custom raven config. For more info check their docs

info Boolean <optional>
false

Send info() messages to sentry

debug Boolean <optional>
false

Send debug() messages to sentry

warning Boolean <optional>
false

Send warn() messages to sentry. If an Error is passed in the arguments, that will be sent alone.

error Boolean <optional>
true

Send error() errors to sentry. If an Error is passed in the arguments, that will be sent alone.

Members

timestamp :String

A formatted timestamp

Type:
  • String

Methods

debug()

Log debugging information

error()

Log an error

info()

Log informal text

log()

Log generic text

warn()

Log a warning