new Log(args)
Construct a new Log instance.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
object |
Properties
|
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 |
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 |
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 |
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 |
Returns:
- Type
- Log