Skip to content


`bunyan -c COND` is broken #61

trentm opened this Issue · 1 comment

1 participant

$ echo '{"b": 1}' | bunyan -c 'a == 1'
{"b": 1}
$ bunyan --version
bunyan 0.16.8

Noted on trentm/json#34 (comment)

@trentm trentm was assigned
@trentm trentm referenced this issue in trentm/json

'json -g -a' should stream #34


Uh, wait, that example above doesn't indicate brokenness. Bunyan ignores json lines that aren't full Bunyan records: i.e. those that have the requisite fields (v, level, time, msg, et al).

$ echo '{"b": 1}' | bunyan --strict

I.e. that isn't a bunyan log record line.

This shows -c working properly:

$ cat foo.js 
var bunyan = require('./lib/bunyan');
var log = bunyan.createLogger({name: 'foo'});{a: 1}, 'hi');{b: 2}, 'hi');
$ node foo.js 
$ node foo.js | bunyan
[2012-12-02T03:11:44.255Z]  INFO: foo/44759 on banana.local: hi (a=1)
[2012-12-02T03:11:44.256Z]  INFO: foo/44759 on banana.local: hi (b=2)
$ node foo.js | bunyan -c 'this.a'
[2012-12-02T03:11:48.592Z]  INFO: foo/44761 on banana.local: hi (a=1)
$ bunyan --version
bunyan 0.16.8
@trentm trentm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.