{"action":"created","issue":{"url":"https://api.github.com/repos/datproject/dat/issues/514","repository_url":"https://api.github.com/repos/datproject/dat","labels_url":"https://api.github.com/repos/datproject/dat/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/datproject/dat/issues/514/comments","events_url":"https://api.github.com/repos/datproject/dat/issues/514/events","html_url":"https://github.com/datproject/dat/pull/514","id":175404335,"number":514,"title":"use message arrays with new status-logger API","user":{"login":"joehand","id":684965,"avatar_url":"https://avatars.githubusercontent.com/u/684965?v=3","gravatar_id":"","url":"https://api.github.com/users/joehand","html_url":"https://github.com/joehand","followers_url":"https://api.github.com/users/joehand/followers","following_url":"https://api.github.com/users/joehand/following{/other_user}","gists_url":"https://api.github.com/users/joehand/gists{/gist_id}","starred_url":"https://api.github.com/users/joehand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehand/subscriptions","organizations_url":"https://api.github.com/users/joehand/orgs","repos_url":"https://api.github.com/users/joehand/repos","events_url":"https://api.github.com/users/joehand/events{/privacy}","received_events_url":"https://api.github.com/users/joehand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-07T03:23:47Z","updated_at":"2016-09-07T21:04:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/datproject/dat/pulls/514","html_url":"https://github.com/datproject/dat/pull/514","diff_url":"https://github.com/datproject/dat/pull/514.diff","patch_url":"https://github.com/datproject/dat/pull/514.patch"},"body":"@juliangruber's recent PR got me thinking about how to improve the logger API (which was not very clear before). I updated the [status-logger](https://github.com/joehand/status-logger) API to print arrays of messages and have the user be responsible for updating the arrays.\r\n\r\nThis PR has two logging lists, `messages` and `progressLines`. `messages` we push and never update.  `progressLines` we update & overwrite. \r\n\r\nDoes this API makes more sense on the logger? \r\n\r\nThe status-logger update also uses [ansi-diff-stream](https://github.com/mafintosh/ansi-diff-stream) so updates are a bit smoother looking."},"comment":{"url":"https://api.github.com/repos/datproject/dat/issues/comments/245418740","html_url":"https://github.com/datproject/dat/pull/514#issuecomment-245418740","issue_url":"https://api.github.com/repos/datproject/dat/issues/514","id":245418740,"user":{"login":"joehand","id":684965,"avatar_url":"https://avatars.githubusercontent.com/u/684965?v=3","gravatar_id":"","url":"https://api.github.com/users/joehand","html_url":"https://github.com/joehand","followers_url":"https://api.github.com/users/joehand/followers","following_url":"https://api.github.com/users/joehand/following{/other_user}","gists_url":"https://api.github.com/users/joehand/gists{/gist_id}","starred_url":"https://api.github.com/users/joehand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehand/subscriptions","organizations_url":"https://api.github.com/users/joehand/orgs","repos_url":"https://api.github.com/users/joehand/repos","events_url":"https://api.github.com/users/joehand/events{/privacy}","received_events_url":"https://api.github.com/users/joehand/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T21:04:38Z","updated_at":"2016-09-07T21:04:38Z","body":"I kind of like the title or one array idea but trying to figure out how it'd work in practice. @juliangruber what does `log.push()` do differently?\r\n\r\nSeems like the title idea would look something like:\r\n\r\n```js\r\n// Dat is initialized\r\nlog.set('directory', 0, 'Starting dat') // Will show \"Sharing Dir\"\r\nlog.set('link', 1, '') // Will show link\r\nlog.set('progress', 2, '')  // will be progress bar\r\nlog.set('swarm', 3, '\\nConnecting...') // will be swarm info + upload/download speed\r\n```\r\n\r\nWould print: \r\n\r\n```\r\nStarting Dat\r\n\r\nConnecting...\r\n```\r\n\r\nThen when we get the key and start adding, the result we want to print is:\r\n```\r\nSharing /Users/joe/node_modules/dat/tests/fixtures\r\n\r\nShare Link: 10942ad84d5d6ab69e74bdca955d6f2a7c37c4d7107e7ab57897fe61c3ddb587\r\nThe Share Link is secret and only those you share it with will be able to get the files\r\n\r\n[====> ] Progress\r\n\r\nWaiting for connections.\r\n```\r\n\r\nSo you'd need something like:\r\n\r\n```\r\nlog.update('directory', 'Sharing Dir')\r\nlog.update('link', 'Share Link: <link> etc')\r\nlog.update('progress', '[====> ] Progress')\r\nlog.update('swarm', '\\nWaiting for connections.')\r\n```\r\n\r\n"}}
{"actor":{"display_login":"joehand"}}