Log

Log

new Log(homey, options)

Construct a new Log instance.

Parameters

Name Type Description
homey
object

this.homey instance in your app (e.g. App#homey/Driver#homey/Device#homey).

options
object

Additional options for Raven

Example

class MyApp extends Homey.App {
  onInit() {
    this.homeyLog = new Log({ homey: this.homey });
  }
}

Methods

captureException

(async) captureException(err): Promise.<string>|undefined

Create and send exception event to Sentry. See the raven-node documentation: https://docs.sentry.io/clients/node/usage/#capturing-errors

Parameters

Name Type Description
err
Error

Error instance to be sent

Returns

Promise.<string> | undefined

captureMessage

(async) captureMessage(message): Promise.<string>|undefined

Create and send message event to Sentry. See the raven-node documentation: https://docs.sentry.io/clients/node/usage/#capturing-messages

Parameters

Name Type Description
message
string

Message to be sent

Returns

Promise.<string> | undefined

setExtra

setExtra(extra): Log

Set extra that will be send as context with every message or error. See the raven-node documentation: https://docs.sentry.io/clients/node/usage/#raven-node-additional-context.

Parameters

Name Type Description
extra
object

Returns

Log

setTags

setTags(tags): Log

Set tags that will be send as context with every message or error. See the raven-node documentation: https://docs.sentry.io/clients/node/usage/#raven-node-additional-context.

Parameters

Name Type Description
tags
object

Returns

Log

setUser

setUser(user): Log

Set user that will be send as context with every message or error. See the raven-node documentation: https://docs.sentry.io/clients/node/usage/#raven-node-additional-context.

Parameters

Name Type Description
user
object

Returns

Log