Skip to content
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

BUG: formatting breaks when 1st parameter is an object #139

Closed
osher opened this issue Nov 29, 2016 · 1 comment · Fixed by #141
Closed

BUG: formatting breaks when 1st parameter is an object #139

osher opened this issue Nov 29, 2016 · 1 comment · Fixed by #141

Comments

@osher
Copy link
Contributor

osher commented Nov 29, 2016

Scenario

create a logger. emit an entry with first parameter as a data object

> const log = require('pino')();
undefined
> log.info({}, "foo %s", "bar");

Expect

well formatted log entry

{"pid":25540,"hostname":"My-PC","name":"foo","level":30,"time":1480447139327,"msg":"foo bar"}

Found

An Error is thrown

TypeError: s.indexOf is not a function
    at countInterp (C:\ws\nodejs\cwt-oapi-util\node_modules\cwt-logger\node_modules\pino\pino.js:378:13)
    at EventEmitter.LOG (C:\ws\nodejs\cwt-oapi-util\node_modules\cwt-logger\node_modules\pino\pino.js:409:11)
    at repl:1:7
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:313:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:513:10)

More info:

version 3.0.2
does not reproduce with version 2.15.0 (regression)

mcollina added a commit that referenced this issue Nov 29, 2016
@mcollina mcollina mentioned this issue Nov 29, 2016
mcollina added a commit that referenced this issue Nov 29, 2016
mcollina added a commit that referenced this issue Nov 29, 2016
mcollina added a commit that referenced this issue Dec 1, 2016
watson pushed a commit to watson/pino that referenced this issue Jan 9, 2017
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant