Skip to content

Commit 4009232

Browse files
Merge pull request #159 from wework/rq-add-javascript-as-root-level-field
Adds javascript to root fields of the logger
2 parents 514560c + 62c89f9 commit 4009232

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/util/common/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const BUNYAN_CONFIG_FIELDS = [
2222
const DEFAULT_ROOT_FIELDS = [
2323
'environment',
2424
'release',
25+
'javascript',
2526
];
2627

2728
/**

test/specs/logger.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ describe('we-js-logger', () => {
166166
beforeEach(() => {
167167
log = new Logger({
168168
release: { foo: 'bar' },
169+
javascript: { browser: 'Chrome' },
169170
});
170171
});
171172

@@ -191,6 +192,10 @@ describe('we-js-logger', () => {
191192
expect(customLog._logger.fields).to.have.property('badIdea');
192193
expect(customLog._logger.fields).not.to.have.property('release');
193194
});
195+
196+
it('should allow the javascript field', () => {
197+
expect(log._logger.fields).to.have.property('javascript');
198+
});
194199
});
195200

196201
describe('log methods', () => {

0 commit comments

Comments
 (0)