-
Notifications
You must be signed in to change notification settings - Fork 846
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
browser write hook #218
browser write hook #218
Conversation
5d9b5b8
to
aa6e685
Compare
browser.js
Outdated
return logger | ||
} | ||
|
||
pino._Pino = Pino | ||
// pino._Pino = Pino |
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.
Why retain this line at all?
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.
accident
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.
LGTM
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.
LGTM
browser.js
Outdated
|
||
function asObject (logger, levels) { | ||
var k | ||
for (var i in 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.
levels
is an array in here.
It looks a bit strange that you're using a normal for loop everywhere else except 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.
good spot!
var proto = opts.browser.write || _console | ||
if (opts.browser.write) opts.browser.asObject = true | ||
|
||
var levels = ['error', 'fatal', 'warn', 'info', 'debug', 'trace'] |
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.
I guess you can move that array into the asObject
function. You don't need it anywhere else.
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.
I do not want to allocate this every time we call asObject
.
aa6e685
to
4457260
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
asObject
optionasObject
is mandatorily enabled ifwrite
is suppliedcc @CyberThom @temsa