-
Notifications
You must be signed in to change notification settings - Fork 21
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
Extra log fields are not logged to browser console #104
Comments
I also tried this in a current version of Firefox and got the same result, the extra fields are not printed. |
It looks like the formatter is expecting a field called |
It looks like It would be much preferred if instead it would construct an object itself with any fields it doesn't specifically handle and log that as the obj rather than requiring a field called |
Here's an example log stream implementation that does it this way:
|
Hi @dobesv Thanks for the feedback. Just to break this down into two parts: Firstly, the behavior for logging objects does deviate a little from Node Bunyan in that you have to use the It's a while since I wrote that, but I think the rationale must have been to prevent the likelihood of conflicts with nested fields that should be serialized, like Secondly, I notice that where the value is a string, with the standard Node Bunyan pretty output, this statement:
results in:
...and I don't think this is handled like this in the built-in streams. So I'm happy to add that. Of course, as a workaround, you can create your own streams which can give you the exact behavior you are looking for. |
When I do something like:
with ConsoleFormattedStream, the object fields are not shown in the JavaScript console.
I feel like this used to work, but not any more. Maybe they changed something in Chrome.
To reproduce, set up a browser-bunyan logger with ConsoleFormattedStream and try logging an object parameter in the latest version of Chrome, see if it shows the object or not.
The text was updated successfully, but these errors were encountered: