{"action":"created","comment":{"url":"https://api.github.com/repos/keybase/client/pulls/comments/50187229","id":50187229,"diff_hunk":"@@ -4,45 +4,40 @@\n package service\n \n import (\n-\t\"fmt\"\n-\n \t\"golang.org/x/net/context\"\n \n+\t\"github.com/keybase/client/go/libkb\"\n \tkeybase1 \"github.com/keybase/client/go/protocol\"\n+\trpc \"github.com/keybase/go-framed-msgpack-rpc\"\n )\n \n-type LogUI struct {\n-\tsessionID int\n-\tcli       *keybase1.LogUiClient\n+// LogHandler is the RPC handler for the log interface.\n+type LogHandler struct {\n+\t*BaseHandler\n+\tlogReg *logRegister\n+\tlibkb.Contextified\n }\n \n-func (l *LogUI) Log(level keybase1.LogLevel, format string, args []interface{}) {\n-\tmsg := fmt.Sprintf(format, args...)\n-\tl.cli.Log(context.TODO(), keybase1.LogArg{\n-\t\tSessionID: l.sessionID,\n-\t\tLevel:     keybase1.LogLevel(level),\n-\t\tText: keybase1.Text{\n-\t\t\tMarkup: false,\n-\t\t\tData:   msg,\n-\t\t},\n-\t})\n+// NewLogHandler creates a LogHandler for the xp transport.\n+func NewLogHandler(xp rpc.Transporter, logReg *logRegister, g *libkb.GlobalContext) *LogHandler {\n+\treturn &LogHandler{\n+\t\tBaseHandler:  NewBaseHandler(xp),\n+\t\tlogReg:       logReg,\n+\t\tContextified: libkb.NewContextified(g),\n+\t}\n }\n \n-func (l *LogUI) Debug(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_DEBUG, format, args)\n-}\n-func (l *LogUI) Info(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_INFO, format, args)\n-}\n-func (l *LogUI) Critical(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_CRITICAL, format, args)\n-}\n-func (l *LogUI) Warning(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_WARN, format, args)\n-}\n-func (l *LogUI) Errorf(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_ERROR, format, args)\n-}\n-func (l *LogUI) Notice(format string, args ...interface{}) {\n-\tl.Log(keybase1.LogLevel_NOTICE, format, args)\n+func (h *LogHandler) RegisterLogger(_ context.Context, arg keybase1.RegisterLoggerArg) (err error) {\n+\th.G().Log.Debug(\"LogHandler::RegisterLogger: %+v\", arg)","path":"go/service/log.go","position":60,"original_position":60,"commit_id":"67c5ac3cc50c684f07d7aa86b4ab7a6a73fafdb2","original_commit_id":"67c5ac3cc50c684f07d7aa86b4ab7a6a73fafdb2","user":{"login":"maxtaco","id":866815,"avatar_url":"https://avatars.githubusercontent.com/u/866815?v=3","gravatar_id":"","url":"https://api.github.com/users/maxtaco","html_url":"https://github.com/maxtaco","followers_url":"https://api.github.com/users/maxtaco/followers","following_url":"https://api.github.com/users/maxtaco/following{/other_user}","gists_url":"https://api.github.com/users/maxtaco/gists{/gist_id}","starred_url":"https://api.github.com/users/maxtaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxtaco/subscriptions","organizations_url":"https://api.github.com/users/maxtaco/orgs","repos_url":"https://api.github.com/users/maxtaco/repos","events_url":"https://api.github.com/users/maxtaco/events{/privacy}","received_events_url":"https://api.github.com/users/maxtaco/received_events","type":"User","site_admin":false},"body":"do we need both of these debugs?","created_at":"2016-01-19T22:35:09Z","updated_at":"2016-01-19T22:35:09Z","html_url":"https://github.com/keybase/client/pull/1768#discussion_r50187229","pull_request_url":"https://api.github.com/repos/keybase/client/pulls/1768","_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/comments/50187229"},"html":{"href":"https://github.com/keybase/client/pull/1768#discussion_r50187229"},"pull_request":{"href":"https://api.github.com/repos/keybase/client/pulls/1768"}}},"pull_request":{"url":"https://api.github.com/repos/keybase/client/pulls/1768","id":56389213,"html_url":"https://github.com/keybase/client/pull/1768","diff_url":"https://github.com/keybase/client/pull/1768.diff","patch_url":"https://github.com/keybase/client/pull/1768.patch","issue_url":"https://api.github.com/repos/keybase/client/issues/1768","number":1768,"state":"open","locked":false,"title":"Change external logging to use queue per connection","user":{"login":"patrickxb","id":2508,"avatar_url":"https://avatars.githubusercontent.com/u/2508?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickxb","html_url":"https://github.com/patrickxb","followers_url":"https://api.github.com/users/patrickxb/followers","following_url":"https://api.github.com/users/patrickxb/following{/other_user}","gists_url":"https://api.github.com/users/patrickxb/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickxb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickxb/subscriptions","organizations_url":"https://api.github.com/users/patrickxb/orgs","repos_url":"https://api.github.com/users/patrickxb/repos","events_url":"https://api.github.com/users/patrickxb/events{/privacy}","received_events_url":"https://api.github.com/users/patrickxb/received_events","type":"User","site_admin":false},"body":"1. Moved external logging code out of logger package.\r\n2. service has a single log forwarder that receives log\r\nmessages from the logger package.\r\n3. New log protocol for RegisterLogger.  Clients have to\r\ncall this if they want service log messages.\r\n4. Have CLI call RegisterLogger.\r\n5. Each connection creates a log queue.  If\r\nRegisterLogger is called, a channel is created with a\r\nprocessing goroutine.\r\n\r\nBonus: in debug mode, added a small timeout before the\r\nclient shuts down to allow it to receive all the log\r\nmessages.  Also, the log queues cleanly shut down so all\r\nthe messages are sent.\r\n\r\nr? @maxtaco ","created_at":"2016-01-18T20:43:29Z","updated_at":"2016-01-19T22:35:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6eddc290e358addecd8cd65ede680a222961b8a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/keybase/client/pulls/1768/commits","review_comments_url":"https://api.github.com/repos/keybase/client/pulls/1768/comments","review_comment_url":"https://api.github.com/repos/keybase/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keybase/client/issues/1768/comments","statuses_url":"https://api.github.com/repos/keybase/client/statuses/67c5ac3cc50c684f07d7aa86b4ab7a6a73fafdb2","head":{"label":"keybase:patrickxb/CORE-2378","ref":"patrickxb/CORE-2378","sha":"67c5ac3cc50c684f07d7aa86b4ab7a6a73fafdb2","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","created_at":"2015-01-11T17:17:12Z","updated_at":"2016-01-19T12:58:38Z","pushed_at":"2016-01-19T22:25:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":139952,"stargazers_count":67,"watchers_count":67,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":33,"forks":7,"open_issues":33,"watchers":67,"default_branch":"master"}},"base":{"label":"keybase:master","ref":"master","sha":"4ac3643ce5ce0cb077e847e1b6b8d09b8eb61e01","user":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"repo":{"id":29099181,"name":"client","full_name":"keybase/client","owner":{"login":"keybase","id":5400834,"avatar_url":"https://avatars.githubusercontent.com/u/5400834?v=3","gravatar_id":"","url":"https://api.github.com/users/keybase","html_url":"https://github.com/keybase","followers_url":"https://api.github.com/users/keybase/followers","following_url":"https://api.github.com/users/keybase/following{/other_user}","gists_url":"https://api.github.com/users/keybase/gists{/gist_id}","starred_url":"https://api.github.com/users/keybase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keybase/subscriptions","organizations_url":"https://api.github.com/users/keybase/orgs","repos_url":"https://api.github.com/users/keybase/repos","events_url":"https://api.github.com/users/keybase/events{/privacy}","received_events_url":"https://api.github.com/users/keybase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keybase/client","description":"Keybase Go Library, Client, Service, OS X, iOS, Android, Electron","fork":false,"url":"https://api.github.com/repos/keybase/client","forks_url":"https://api.github.com/repos/keybase/client/forks","keys_url":"https://api.github.com/repos/keybase/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keybase/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keybase/client/teams","hooks_url":"https://api.github.com/repos/keybase/client/hooks","issue_events_url":"https://api.github.com/repos/keybase/client/issues/events{/number}","events_url":"https://api.github.com/repos/keybase/client/events","assignees_url":"https://api.github.com/repos/keybase/client/assignees{/user}","branches_url":"https://api.github.com/repos/keybase/client/branches{/branch}","tags_url":"https://api.github.com/repos/keybase/client/tags","blobs_url":"https://api.github.com/repos/keybase/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keybase/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keybase/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/keybase/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keybase/client/statuses/{sha}","languages_url":"https://api.github.com/repos/keybase/client/languages","stargazers_url":"https://api.github.com/repos/keybase/client/stargazers","contributors_url":"https://api.github.com/repos/keybase/client/contributors","subscribers_url":"https://api.github.com/repos/keybase/client/subscribers","subscription_url":"https://api.github.com/repos/keybase/client/subscription","commits_url":"https://api.github.com/repos/keybase/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/keybase/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/keybase/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/keybase/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/keybase/client/contents/{+path}","compare_url":"https://api.github.com/repos/keybase/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keybase/client/merges","archive_url":"https://api.github.com/repos/keybase/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keybase/client/downloads","issues_url":"https://api.github.com/repos/keybase/client/issues{/number}","pulls_url":"https://api.github.com/repos/keybase/client/pulls{/number}","milestones_url":"https://api.github.com/repos/keybase/client/milestones{/number}","notifications_url":"https://api.github.com/repos/keybase/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keybase/client/labels{/name}","releases_url":"https://api.github.com/repos/keybase/client/releases{/id}","created_at":"2015-01-11T17:17:12Z","updated_at":"2016-01-19T12:58:38Z","pushed_at":"2016-01-19T22:25:13Z","git_url":"git://github.com/keybase/client.git","ssh_url":"git@github.com:keybase/client.git","clone_url":"https://github.com/keybase/client.git","svn_url":"https://github.com/keybase/client","homepage":"","size":139952,"stargazers_count":67,"watchers_count":67,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":33,"forks":7,"open_issues":33,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keybase/client/pulls/1768"},"html":{"href":"https://github.com/keybase/client/pull/1768"},"issue":{"href":"https://api.github.com/repos/keybase/client/issues/1768"},"comments":{"href":"https://api.github.com/repos/keybase/client/issues/1768/comments"},"review_comments":{"href":"https://api.github.com/repos/keybase/client/pulls/1768/comments"},"review_comment":{"href":"https://api.github.com/repos/keybase/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keybase/client/pulls/1768/commits"},"statuses":{"href":"https://api.github.com/repos/keybase/client/statuses/67c5ac3cc50c684f07d7aa86b4ab7a6a73fafdb2"}}}}