pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

obj.hasOwnProperty is not a function #180

Closed ronag closed 7 years ago

ronag commented 7 years ago

Found this deep inside our server logs

obj.hasOwnProperty is not a function
    at EventEmitter.asJson (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/pino.js:175:15)
    at EventEmitter.Pino.write (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/pino.js:224:16)
    at EventEmitter.LOG (/Users/ronagy/Projects/github/nxtedition/nxt-storage/node_modules/pino/lib/tools.js:116:10)

Not sure how to reproduce it.

jsumners commented 7 years ago

Did it start with a specific version of Pino?

mcollina commented 7 years ago

It would help to know what are you logging to cause this, otherwise it would be very hard to track.

davidmarkclements commented 7 years ago

ok I know what it is

var o = Object.create(null)
o.foo = 1
pino.info(o) // TypeError: obj.hasOwnProperty is not a function

I think we'll have to do a check for hasOwnProperty - if it it's not there we don't need to do the check

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.