{"action":"created","issue":{"url":"https://api.github.com/repos/mcollina/pino/issues/106","repository_url":"https://api.github.com/repos/mcollina/pino","labels_url":"https://api.github.com/repos/mcollina/pino/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/mcollina/pino/issues/106/comments","events_url":"https://api.github.com/repos/mcollina/pino/issues/106/events","html_url":"https://github.com/mcollina/pino/pull/106","id":183179313,"number":106,"title":"Add support for multiple streams","user":{"login":"jsumners","id":321201,"avatar_url":"https://avatars.githubusercontent.com/u/321201?v=3","gravatar_id":"","url":"https://api.github.com/users/jsumners","html_url":"https://github.com/jsumners","followers_url":"https://api.github.com/users/jsumners/followers","following_url":"https://api.github.com/users/jsumners/following{/other_user}","gists_url":"https://api.github.com/users/jsumners/gists{/gist_id}","starred_url":"https://api.github.com/users/jsumners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsumners/subscriptions","organizations_url":"https://api.github.com/users/jsumners/orgs","repos_url":"https://api.github.com/users/jsumners/repos","events_url":"https://api.github.com/users/jsumners/events{/privacy}","received_events_url":"https://api.github.com/users/jsumners/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-10-15T00:58:03Z","updated_at":"2016-10-15T18:55:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mcollina/pino/pulls/106","html_url":"https://github.com/mcollina/pino/pull/106","diff_url":"https://github.com/mcollina/pino/pull/106.diff","patch_url":"https://github.com/mcollina/pino/pull/106.patch"},"body":"This PR adds a wrapper around `pino` that allows multiple destination streams to be specified. Example (from the readme):\r\n\r\n```js\r\nvar fs = require('fs')\r\nvar mspino = require('pino/multi-stream')\r\nvar streams = [\r\n  {stream: fs.createWriteStream('/tmp/info.stream.out')},\r\n  {level: 'fatal', fs.createWriteStream('/tmp/fatal.stream.out')}\r\n]\r\nvar log = mspino({streams: streams})\r\n\r\nlog.info('this will be written to /tmp/info.stream.out')\r\nlog.fatal('this will be written to /tmp/fatal.stream.out')\r\n```\r\n\r\nThis further increases the compatibility with the Bunyan API. It does, however, come with significant cost. On my machine, the included benchmark, which goes to 10 destination streams, run three consecutive times results in:\r\n\r\n```\r\nbenchBunyan*10000: 1835.647ms\r\nbenchMSPino*10000: 1605.660ms\r\n\r\nbenchBunyan*10000: 1945.961ms\r\nbenchMSPino*10000: 1643.411ms\r\n\r\nbenchBunyan*10000: 1909.204ms\r\nbenchMSPino*10000: 1684.122ms\r\n```\r\n\r\nI'm sure the code can be improved, but I wanted to get feedback on if it should be included or not before thinking too hard on it. What do you think @mcollina and @davidmarkclements ?"},"comment":{"url":"https://api.github.com/repos/mcollina/pino/issues/comments/254003819","html_url":"https://github.com/mcollina/pino/pull/106#issuecomment-254003819","issue_url":"https://api.github.com/repos/mcollina/pino/issues/106","id":254003819,"user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T18:55:23Z","updated_at":"2016-10-15T18:55:23Z","body":"I'm moving towards accepting this. The overhead over \"normal\" pino is negligible, but people should really not do multi-stream.\r\n\r\nThis was also asked in https://github.com/mcollina/pino/issues/80."}}
{"actor":{"display_login":"mcollina"}}