Class: Log

Log(args)

new Log(args)

Construct a new Log instance.

Parameters:
Name Type Description
args object
Properties
Name Type Attributes Description
homey HomeyInstance

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

options object <optional>

Additional options for Sentry

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

Methods

(async) captureException(err) → {Promise.<string>|undefined}

Create and send exception event to Sentry. See the sentry Node.js documentation: https://docs.sentry.io/platforms/javascript/guides/node/usage/

Parameters:
Name Type Description
err Error

Error instance to be sent

Source:
Returns:
Type
Promise.<string> | undefined

(async) captureMessage(message) → {Promise.<string>|undefined}

Create and send message event to Sentry. See the Sentry Node.js documentation: https://docs.sentry.io/platforms/javascript/guides/node/usage/

Parameters:
Name Type Description
message string

Message to be sent

Source:
Returns:
Type
Promise.<string> | undefined

setTags(tags) → {Log}

Set tags that will be sent as context with every message or error. See the Sentry Node.js documentation: https://docs.sentry.io/platforms/javascript/guides/node/enriching-events/tags/

Parameters:
Name Type Description
tags object
Source:
Returns:
Type
Log

setUser(user) → {Log}

Set user that will be sent as context with every message or error. See the Sentry Node.js documentation: https://docs.sentry.io/platforms/javascript/guides/node/enriching-events/identify-user/.

Parameters:
Name Type Description
user object
Source:
Returns:
Type
Log