{"action":"created","issue":{"url":"https://api.github.com/repos/mattdesl/garnish/issues/20","labels_url":"https://api.github.com/repos/mattdesl/garnish/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/mattdesl/garnish/issues/20/comments","events_url":"https://api.github.com/repos/mattdesl/garnish/issues/20/events","html_url":"https://github.com/mattdesl/garnish/issues/20","id":114526843,"number":20,"title":"redesign output format","user":{"login":"yoshuawuyts","id":2467194,"avatar_url":"https://avatars.githubusercontent.com/u/2467194?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshuawuyts","html_url":"https://github.com/yoshuawuyts","followers_url":"https://api.github.com/users/yoshuawuyts/followers","following_url":"https://api.github.com/users/yoshuawuyts/following{/other_user}","gists_url":"https://api.github.com/users/yoshuawuyts/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshuawuyts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshuawuyts/subscriptions","organizations_url":"https://api.github.com/users/yoshuawuyts/orgs","repos_url":"https://api.github.com/users/yoshuawuyts/repos","events_url":"https://api.github.com/users/yoshuawuyts/events{/privacy}","received_events_url":"https://api.github.com/users/yoshuawuyts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-02T05:15:28Z","updated_at":"2015-11-03T02:25:48Z","closed_at":null,"body":"I've always been a fan of [koa-logger](https://github.com/koajs/logger). I think in particular the http `response` / `request` logging is pretty:\r\n```txt\r\n<-- GET /\r\n--> GET / 200 835ms 746b\r\n<-- GET /\r\nxxx GET / 503 960ms 1.9kb\r\n<-- GET /users\r\n--> GET /users 200 357ms 922b\r\n```\r\nRight now `http-ndjson` logs http with either `message: 'request'` or `message: 'response'`. I think it might be cool if we formatted these messages to be a bit more.. _pretty_. E.g.\r\n- `request` becomes `<--`\r\n- `response` in the `2xx` range becomes `-->`\r\n- `response` in the `{4,5}xx` range becomes `xxx` in red\r\n\r\nWhat do you reckon?\r\n\r\n__edit:__ not entirely sure about `xxx` for errors, as user land errors are quite common (as opposed to programmer errors). On the other hand: `garnish` is a development tool, so making all types of errors stand out might make sense."},"comment":{"url":"https://api.github.com/repos/mattdesl/garnish/issues/comments/153219674","html_url":"https://github.com/mattdesl/garnish/issues/20#issuecomment-153219674","issue_url":"https://api.github.com/repos/mattdesl/garnish/issues/20","id":153219674,"user":{"login":"yoshuawuyts","id":2467194,"avatar_url":"https://avatars.githubusercontent.com/u/2467194?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshuawuyts","html_url":"https://github.com/yoshuawuyts","followers_url":"https://api.github.com/users/yoshuawuyts/followers","following_url":"https://api.github.com/users/yoshuawuyts/following{/other_user}","gists_url":"https://api.github.com/users/yoshuawuyts/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshuawuyts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshuawuyts/subscriptions","organizations_url":"https://api.github.com/users/yoshuawuyts/orgs","repos_url":"https://api.github.com/users/yoshuawuyts/repos","events_url":"https://api.github.com/users/yoshuawuyts/events{/privacy}","received_events_url":"https://api.github.com/users/yoshuawuyts/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T02:25:48Z","updated_at":"2015-11-03T02:25:48Z","body":"What do you think of this?\r\n\r\n__req enabled__\r\n```txt\r\n[0000] GET   <--                       /index.html\r\n[0000] GET   -->  200   14ms      498B /index.html\r\n[0001] POST  <--                       /oh-no.json\r\n[0001] POST  -->  500    1ms       10B /oh-no.json\r\n```\r\n__req disabled__ (compact mode)\r\n```txt\r\n[0000] GET   200   14ms      498B /index.html\r\n[0001] POST  500    1ms       10B /oh-no.json\r\n```\r\n\r\n- __field 1:__ delta time offset in seconds since init. [logrus](https://github.com/Sirupsen/logrus)\r\n  does this and I've found it to be quite pleasant. With 4 digits it takes about 3 hours before the numbers reset to `0000`.\r\n- __field 2:__ HTTP method\r\n- __field 3:__ conditional req / res identifier. Triggered by a message of `request` or `response`.\r\n  Disabled in compact mode.\r\n- __field 4:__ HTTP Status code\r\n- __field 5:__ time elapsed (upper bound of `99999ms` or `9.9sec` for row length)\r\n- __field 6:__ bytes sent (upper bound of `99999999B` or ~`9mb` for row length)\r\n- __field 7:__ url\r\n\r\nThis wouldn't be relevant for non-http logging though. I'm not sure what other type of information would regularly be logged. In debug mode there might be a myriad of messages, but in production perhaps only `.on('unhandledException')` errors? Any fields we should consider?"}}