diff --git a/LICENSE.md b/LICENSE.md index ba62d07..869edb0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,3 @@ -senselogs License -=== - MIT License Copyright (c) 2019-2020 Michael O'Brien diff --git a/README.md b/README.md index 8da66b0..50b9b11 100644 --- a/README.md +++ b/README.md @@ -393,7 +393,7 @@ But for all others, you can connect the redact function to any one of the NPM re ### SenseLogs Class API -The SenseLogs class provides the public API for SenseLogs and public properties.. +The SenseLogs class provides the public API for SenseLogs and public properties. ### SenseLogs Constructor diff --git a/src/index.d.ts b/src/index.d.ts index a1c167b..43671db 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -2,8 +2,6 @@ SenseLogs TypeScript definitions */ -import { MessageChannel } from "worker_threads"; - type Destination = { write: (log: SenseLogs, context: {}) => void }; diff --git a/src/index.js b/src/index.js index ce53557..fa8dab7 100644 --- a/src/index.js +++ b/src/index.js @@ -430,16 +430,20 @@ export default class SenseLogs { /* Emit a CloudWatch metic using the CloudWatch EMF format. - metrics('metrics', message, 'MyCompany/MyApp', {UserSessions: 1}, dimensions, {UserSessions: 'Count'}) + metrics(chan, message, 'MyCompany/MyApp', {UserSessions: 1}, dimensions, {UserSessions: 'Count'}) */ metrics(chan, message, namespace, values, dimensions = [[]], units = null) { - if (!this.#top.#filter.metrics) { + let top = this.#top + if (!top.#filter.metrics) { return } /* istanbul ignore next */ if (!namespace || !values) { throw new Error('Missing namespace or values') } + if (!this.enabled(chan, 1)) { + return + } let keys = Object.keys(values).filter(v => dimensions[0].indexOf(v) < 0) let metrics = keys.map(name => { let def = {Name: name}