Skip to content

Commit

Permalink
feat: add symbols to reference certain private properties on LogMessa…
Browse files Browse the repository at this point in the history
…ge class

BREAKING CHANGE: Previously you could directly access the private properties of LambdaLog. In order to add some integrity, they are no longer using standard property names starting with an underscore and are instead referenced using symbols instead. For advanced usage, these symbols are exported as a static property on the LambdaLog class under `LambdaLog.symbols`.
  • Loading branch information
KyleRoss committed Apr 12, 2021
1 parent fbcca6d commit 952b62d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/LambdaLog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const EventEmitter = require('events');
const LogMessage = require('./LogMessage');

const symbols = {
LEVELS: Symbol('levels')
};

/**
* @external EventEmitter
* @see https://nodejs.org/api/events.html#events_class_eventemitter
Expand Down Expand Up @@ -221,4 +225,6 @@ class LambdaLog extends EventEmitter {
}
}

LambdaLog.symbols = symbols;

module.exports = LambdaLog;

0 comments on commit 952b62d

Please sign in to comment.