-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Style updates to adhere to eslint-config-wework
- Loading branch information
Mike Nason
committed
Feb 10, 2017
1 parent
68ca93e
commit c059822
Showing
22 changed files
with
155 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const Benchmark = require('benchmark') | ||
const Benchmark = require('benchmark'); | ||
const bunyan = require('bunyan'); | ||
const WeLogger = require('../..'); | ||
|
||
var suite = new Benchmark.Suite(); | ||
const suite = new Benchmark.Suite(); | ||
|
||
const weLogger = new WeLogger({ stdout: false }); | ||
const weLoggerScrub = new WeLogger({ stdout: false, scrubFields: ['foo'] }); | ||
const bunyanLogger = bunyan.createLogger({ name: 'bunyan', streams: [] }); | ||
|
||
const context = { | ||
data: { some: 'stuff' }, | ||
foo: 'bar' | ||
foo: 'bar', | ||
}; | ||
const msg = 'hello world'; | ||
const msgExtra = { pretty: 'print me please' }; | ||
|
||
suite | ||
.add('we-js-logger', function() { | ||
.add('we-js-logger', () => { | ||
weLogger.info(context, msg, msgExtra); | ||
}) | ||
.add('we-js-logger child', function() { | ||
.add('we-js-logger child', () => { | ||
const log = weLogger.child(); | ||
log.info(context, msg, msgExtra); | ||
}) | ||
.add('we-js-logger (with scrub fields)', function() { | ||
weLoggerScrub.info(context, msg, msgExtra) | ||
.add('we-js-logger (with scrub fields)', () => { | ||
weLoggerScrub.info(context, msg, msgExtra); | ||
}) | ||
.add('we-js-logger child (with scrub fields)', function() { | ||
.add('we-js-logger child (with scrub fields)', () => { | ||
const log = weLoggerScrub.child(); | ||
log.info(context, msg, msgExtra); | ||
}) | ||
.add('bunyan', function() { | ||
.add('bunyan', () => { | ||
bunyanLogger.info(context, msg, msgExtra); | ||
}) | ||
.add('bunyan child', function() { | ||
.add('bunyan child', () => { | ||
const log = bunyanLogger.child(); | ||
log.info(context, msg, msgExtra); | ||
}) | ||
// add listeners | ||
.on('cycle', function(event) { | ||
.on('cycle', (event) => { | ||
console.log(String(event.target)); | ||
}) | ||
.on('complete', function() { | ||
console.log('Fastest is ' + this.filter('fastest').map('name')); | ||
.on('complete', function () { | ||
console.log(`Fastest is ${this.filter('fastest').map('name')}`); | ||
}) | ||
// run async | ||
.run({ 'async': true }); | ||
.run({ async: true }); |
Oops, something went wrong.