-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make config.scrubFields work globally, not just for Rollbar #53
Conversation
e6b03a5
to
6345059
Compare
Coverage increased (+4.4%) to 76.404% when pulling e6b03a5c72f8ba9852a7288f523387bf0b3d37fa on feature/globalscrubfields into 1acbe52 on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweeeet
* https://github.com/trentm/node-bunyan#levels | ||
* @type {Array} | ||
*/ | ||
export const BUNYAN_LOGGER_LEVELS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its unlikely, but we'll need to keep this in sync with any changes in bunyan. What if we pulled this from bunyan itself:
import { levelFromName } from 'node-bunyan';
...
export const BUNYAN_LOGGER_LEVELS = Object.keys(levelFromName)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice, yeah I like this better
@@ -99,8 +99,41 @@ describe('we-js-logger', () => { | |||
it.skip('accepts custom serializers', () => {}); | |||
}); | |||
|
|||
describe('config.scrubFields', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dope. Can we test this with a log child as well here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dope
👍 👍 |
In this pr #47 I added functionality to scrub all fields being passed through before being sent to Rollbar.
This pr extends that functionality to both the
fields
object (first argument in logger functions if it's an object), or the objects you might pass in to be logger messages: