{"action":"created","issue":{"url":"https://api.github.com/repos/flightstats/node-insights/issues/16","labels_url":"https://api.github.com/repos/flightstats/node-insights/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/flightstats/node-insights/issues/16/comments","events_url":"https://api.github.com/repos/flightstats/node-insights/issues/16/events","html_url":"https://github.com/flightstats/node-insights/issues/16","id":99056504,"number":16,"title":"Document the logger (and maybe change it?)","user":{"login":"wraithan","id":90898,"avatar_url":"https://avatars.githubusercontent.com/u/90898?v=3","gravatar_id":"","url":"https://api.github.com/users/wraithan","html_url":"https://github.com/wraithan","followers_url":"https://api.github.com/users/wraithan/followers","following_url":"https://api.github.com/users/wraithan/following{/other_user}","gists_url":"https://api.github.com/users/wraithan/gists{/gist_id}","starred_url":"https://api.github.com/users/wraithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wraithan/subscriptions","organizations_url":"https://api.github.com/users/wraithan/orgs","repos_url":"https://api.github.com/users/wraithan/repos","events_url":"https://api.github.com/users/wraithan/events{/privacy}","received_events_url":"https://api.github.com/users/wraithan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-04T20:36:17Z","updated_at":"2015-08-05T16:13:45Z","closed_at":null,"body":"The logger is a `console` instance by default. This means, to be safe, the user must implement:\r\n\r\n```\r\n> Object.keys(console)\r\n[ 'log',\r\n  'info',\r\n  'warn',\r\n  'error',\r\n  'dir',\r\n  'time',\r\n  'timeEnd',\r\n  'trace',\r\n  'assert',\r\n  'Console' ]\r\n```\r\n\r\nA logger API could be something like `function logger (level, message) {}` or something like that. It would require your own calls to `util.format` instead of relying on the logger to do it, but you could easily abstract that in your code. "},"comment":{"url":"https://api.github.com/repos/flightstats/node-insights/issues/comments/128054620","html_url":"https://github.com/flightstats/node-insights/issues/16#issuecomment-128054620","issue_url":"https://api.github.com/repos/flightstats/node-insights/issues/16","id":128054620,"user":{"login":"mattpage","id":732573,"avatar_url":"https://avatars.githubusercontent.com/u/732573?v=3","gravatar_id":"","url":"https://api.github.com/users/mattpage","html_url":"https://github.com/mattpage","followers_url":"https://api.github.com/users/mattpage/followers","following_url":"https://api.github.com/users/mattpage/following{/other_user}","gists_url":"https://api.github.com/users/mattpage/gists{/gist_id}","starred_url":"https://api.github.com/users/mattpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattpage/subscriptions","organizations_url":"https://api.github.com/users/mattpage/orgs","repos_url":"https://api.github.com/users/mattpage/repos","events_url":"https://api.github.com/users/mattpage/events{/privacy}","received_events_url":"https://api.github.com/users/mattpage/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T16:13:45Z","updated_at":"2015-08-05T16:13:45Z","body":"@wraithan, the [util.log](https://nodejs.org/api/util.html) method writes to stdout. To write to stderr, we would need to use either console.error or process.stderr.write(...);\r\n\r\nSo if we adopt your suggested interface:\r\n```\r\nfunction logger (level, message) {}\r\n```\r\nthen how about something like:\r\n```\r\nif (level === 'error'){\r\n  console.error.apply(this, arguments);\r\n}\r\nelse {\r\n  console.log.apply(this, arguments);\r\n}\r\n```\r\nalthough we may want to shift off the first arg.\r\n\r\n"}}