{"action":"created","comment":{"url":"https://api.github.com/repos/ensime/ensime-vim/pulls/comments/72997696","id":72997696,"diff_hunk":"@@ -202,9 +210,9 @@ def setup(self, quiet=False, bootstrap_server=False):\n         def lazy_initialize_ensime():\n             if not self.ensime:\n                 called_by = inspect.stack()[4][3]\n-                self.log(str(inspect.stack()))\n-                self.log(\"setup(quiet={}, bootstrap_server={}) called by {}()\"\n-                         .format(quiet, bootstrap_server, called_by))\n+                self.log.debug(str(inspect.stack()))","path":"ensime_shared/ensime.py","position":158,"original_position":158,"commit_id":"d5030d7dab9d521f080a9d403984237e1557224c","original_commit_id":"d5030d7dab9d521f080a9d403984237e1557224c","user":{"login":"ktonga","id":1324947,"avatar_url":"https://avatars.githubusercontent.com/u/1324947?v=3","gravatar_id":"","url":"https://api.github.com/users/ktonga","html_url":"https://github.com/ktonga","followers_url":"https://api.github.com/users/ktonga/followers","following_url":"https://api.github.com/users/ktonga/following{/other_user}","gists_url":"https://api.github.com/users/ktonga/gists{/gist_id}","starred_url":"https://api.github.com/users/ktonga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktonga/subscriptions","organizations_url":"https://api.github.com/users/ktonga/orgs","repos_url":"https://api.github.com/users/ktonga/repos","events_url":"https://api.github.com/users/ktonga/events{/privacy}","received_events_url":"https://api.github.com/users/ktonga/received_events","type":"User","site_admin":false},"body":"Nope. Go ahead and merge it.","created_at":"2016-08-01T15:25:25Z","updated_at":"2016-08-01T15:25:25Z","html_url":"https://github.com/ensime/ensime-vim/pull/323#discussion_r72997696","pull_request_url":"https://api.github.com/repos/ensime/ensime-vim/pulls/323","_links":{"self":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/comments/72997696"},"html":{"href":"https://github.com/ensime/ensime-vim/pull/323#discussion_r72997696"},"pull_request":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/323"}}},"pull_request":{"url":"https://api.github.com/repos/ensime/ensime-vim/pulls/323","id":79171745,"html_url":"https://github.com/ensime/ensime-vim/pull/323","diff_url":"https://github.com/ensime/ensime-vim/pull/323.diff","patch_url":"https://github.com/ensime/ensime-vim/pull/323.patch","issue_url":"https://api.github.com/repos/ensime/ensime-vim/issues/323","number":323,"state":"open","locked":false,"title":"Use a proper logger","user":{"login":"ches","id":13277,"avatar_url":"https://avatars.githubusercontent.com/u/13277?v=3","gravatar_id":"","url":"https://api.github.com/users/ches","html_url":"https://github.com/ches","followers_url":"https://api.github.com/users/ches/followers","following_url":"https://api.github.com/users/ches/following{/other_user}","gists_url":"https://api.github.com/users/ches/gists{/gist_id}","starred_url":"https://api.github.com/users/ches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ches/subscriptions","organizations_url":"https://api.github.com/users/ches/orgs","repos_url":"https://api.github.com/users/ches/repos","events_url":"https://api.github.com/users/ches/events{/privacy}","received_events_url":"https://api.github.com/users/ches/received_events","type":"User","site_admin":false},"body":"This is a first pass at #297. It does not attempt to hide trace logging code with decorators, etc. yet, I'm punting on the question of adding a dependency or rolling our own for now.\r\n\r\nThis uses the standard library `logging` module to get rid of the hacky inefficiency of our own homegrown `log` function that re-opens a file handle on every single call. It also adds sensible leveled logging, putting our trace-level logging statements at `DEBUG` level and logging more quietly than that by default.\r\n\r\nFor now I've just used an environment variable, `ENSIME_VIM_DEBUG`, as a binary toggle between `INFO` and `DEBUG` logging levels. I could add a `g:ensime_debug` Vim variable, we could make it possible to specify where logging goes instead of being hardcoded to `.ensime_cache/ensime-vim.log`, etc., but initially I wanted to add minimal features, just leveled logging with an as-simple-as-possible toggle for the level. Open to feedback.\r\n\r\nI'm already finding it helpful to have file and line number of log statements in the output, and the `logging` module's native ability to show exception backtraces in the log. Here's an example of some debug output:\r\n\r\n```\r\nDEBUG    <2016-07-28 17:04:03,109> (ensime.py:272) - send: in\r\nDEBUG    <2016-07-28 17:04:03,109> (ensime.py:275) - send: {\"callId\": 0, \"req\": {\"typehint\": \"ConnectionInfoReq\"}}\r\nDEBUG    <2016-07-28 17:04:04,126> (ensime.py:750) - unqueue: result received\r\n{\r\n  \"callId\": 0,\r\n  \"payload\": {\r\n    \"typehint\": \"ConnectionInfo\",\r\n    \"implementation\": {\r\n      \"name\": \"ENSIME\"\r\n    },\r\n    \"version\": \"1.0\"\r\n  }\r\n}\r\nDEBUG    <2016-07-28 17:04:04,126> (protocol.py:48) - handle_incoming_response: in {u'implementation': {u'name': u'ENSIME'}, u'typehint': u'ConnectionInfo', u'version': u'1.0'}\r\nWARNING  <2016-07-28 17:04:04,126> (protocol.py:61) - Response has not been handled: {u'implementation': {u'name': u'ENSIME'}, u'typehint': u'ConnectionInfo', u'version': u'1.0'}\r\nDEBUG    <2016-07-28 17:04:05,145> (ensime.py:750) - unqueue: result received\r\n{\r\n  \"payload\": {\r\n    \"typehint\": \"IndexerReadyEvent\"\r\n  }\r\n}\r\nDEBUG    <2016-07-28 17:04:05,145> (protocol.py:48) - handle_incoming_response: in {u'typehint': u'IndexerReadyEvent'}\r\nDEBUG    <2016-07-28 17:04:05,145> (ensime.py:386) - message: in\r\nDEBUG    <2016-07-28 17:04:05,145> (ensime.py:387) - [ensime] Indexer is ready\r\nDEBUG    <2016-07-28 17:04:07,177> (ensime.py:750) - unqueue: result received\r\n{\r\n  \"payload\": {\r\n    \"typehint\": \"SendBackgroundMessageEvent\",\r\n    \"detail\": \"Initializing Analyzer. Please wait...\",\r\n    \"code\": 105\r\n  }\r\n}\r\nDEBUG    <2016-07-28 17:04:07,177> (protocol.py:48) - handle_incoming_response: in {u'code': 105, u'typehint': u'SendBackgroundMessageEvent', u'detail': u'Initializing Analyzer. Please wait...'}\r\nWARNING  <2016-07-28 17:04:07,177> (protocol.py:61) - Response has not been handled: {u'code': 105, u'typehint': u'SendBackgroundMessageEvent', u'detail': u'Initializing Analyzer. Please wait...'}\r\nDEBUG    <2016-07-28 17:04:08,187> (ensime.py:750) - unqueue: result received\r\n{\r\n  \"payload\": {\r\n    \"typehint\": \"AnalyzerReadyEvent\"\r\n  }\r\n}\r\nDEBUG    <2016-07-28 17:04:08,187> (protocol.py:48) - handle_incoming_response: in {u'typehint': u'AnalyzerReadyEvent'}\r\nDEBUG    <2016-07-28 17:04:08,187> (ensime.py:386) - message: in\r\nDEBUG    <2016-07-28 17:04:08,187> (ensime.py:387) - [ensime] Analyzer is ready\r\nDEBUG    <2016-07-28 17:04:08,187> (ensime.py:750) - unqueue: result received\r\n{\r\n  \"payload\": {\r\n    \"typehint\": \"FullTypeCheckCompleteEvent\"\r\n  }\r\n}\r\nDEBUG    <2016-07-28 17:04:08,187> (protocol.py:48) - handle_incoming_response: in {u'typehint': u'FullTypeCheckCompleteEvent'}\r\n```","created_at":"2016-07-28T10:26:24Z","updated_at":"2016-08-01T15:25:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c7dff44ffe27b5455d6f9d9b6d517dcbff6b167","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ensime/ensime-vim/pulls/323/commits","review_comments_url":"https://api.github.com/repos/ensime/ensime-vim/pulls/323/comments","review_comment_url":"https://api.github.com/repos/ensime/ensime-vim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ensime/ensime-vim/issues/323/comments","statuses_url":"https://api.github.com/repos/ensime/ensime-vim/statuses/d5030d7dab9d521f080a9d403984237e1557224c","head":{"label":"ches:logging","ref":"logging","sha":"d5030d7dab9d521f080a9d403984237e1557224c","user":{"login":"ches","id":13277,"avatar_url":"https://avatars.githubusercontent.com/u/13277?v=3","gravatar_id":"","url":"https://api.github.com/users/ches","html_url":"https://github.com/ches","followers_url":"https://api.github.com/users/ches/followers","following_url":"https://api.github.com/users/ches/following{/other_user}","gists_url":"https://api.github.com/users/ches/gists{/gist_id}","starred_url":"https://api.github.com/users/ches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ches/subscriptions","organizations_url":"https://api.github.com/users/ches/orgs","repos_url":"https://api.github.com/users/ches/repos","events_url":"https://api.github.com/users/ches/events{/privacy}","received_events_url":"https://api.github.com/users/ches/received_events","type":"User","site_admin":false},"repo":{"id":55591733,"name":"ensime-vim","full_name":"ches/ensime-vim","owner":{"login":"ches","id":13277,"avatar_url":"https://avatars.githubusercontent.com/u/13277?v=3","gravatar_id":"","url":"https://api.github.com/users/ches","html_url":"https://github.com/ches","followers_url":"https://api.github.com/users/ches/followers","following_url":"https://api.github.com/users/ches/following{/other_user}","gists_url":"https://api.github.com/users/ches/gists{/gist_id}","starred_url":"https://api.github.com/users/ches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ches/subscriptions","organizations_url":"https://api.github.com/users/ches/orgs","repos_url":"https://api.github.com/users/ches/repos","events_url":"https://api.github.com/users/ches/events{/privacy}","received_events_url":"https://api.github.com/users/ches/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ches/ensime-vim","description":"ENSIME for the Editor of the Beast (Vim)","fork":true,"url":"https://api.github.com/repos/ches/ensime-vim","forks_url":"https://api.github.com/repos/ches/ensime-vim/forks","keys_url":"https://api.github.com/repos/ches/ensime-vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ches/ensime-vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ches/ensime-vim/teams","hooks_url":"https://api.github.com/repos/ches/ensime-vim/hooks","issue_events_url":"https://api.github.com/repos/ches/ensime-vim/issues/events{/number}","events_url":"https://api.github.com/repos/ches/ensime-vim/events","assignees_url":"https://api.github.com/repos/ches/ensime-vim/assignees{/user}","branches_url":"https://api.github.com/repos/ches/ensime-vim/branches{/branch}","tags_url":"https://api.github.com/repos/ches/ensime-vim/tags","blobs_url":"https://api.github.com/repos/ches/ensime-vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ches/ensime-vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ches/ensime-vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/ches/ensime-vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ches/ensime-vim/statuses/{sha}","languages_url":"https://api.github.com/repos/ches/ensime-vim/languages","stargazers_url":"https://api.github.com/repos/ches/ensime-vim/stargazers","contributors_url":"https://api.github.com/repos/ches/ensime-vim/contributors","subscribers_url":"https://api.github.com/repos/ches/ensime-vim/subscribers","subscription_url":"https://api.github.com/repos/ches/ensime-vim/subscription","commits_url":"https://api.github.com/repos/ches/ensime-vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/ches/ensime-vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/ches/ensime-vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/ches/ensime-vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/ches/ensime-vim/contents/{+path}","compare_url":"https://api.github.com/repos/ches/ensime-vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ches/ensime-vim/merges","archive_url":"https://api.github.com/repos/ches/ensime-vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ches/ensime-vim/downloads","issues_url":"https://api.github.com/repos/ches/ensime-vim/issues{/number}","pulls_url":"https://api.github.com/repos/ches/ensime-vim/pulls{/number}","milestones_url":"https://api.github.com/repos/ches/ensime-vim/milestones{/number}","notifications_url":"https://api.github.com/repos/ches/ensime-vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ches/ensime-vim/labels{/name}","releases_url":"https://api.github.com/repos/ches/ensime-vim/releases{/id}","deployments_url":"https://api.github.com/repos/ches/ensime-vim/deployments","created_at":"2016-04-06T09:09:28Z","updated_at":"2016-04-06T09:09:29Z","pushed_at":"2016-08-01T13:57:08Z","git_url":"git://github.com/ches/ensime-vim.git","ssh_url":"git@github.com:ches/ensime-vim.git","clone_url":"https://github.com/ches/ensime-vim.git","svn_url":"https://github.com/ches/ensime-vim","homepage":null,"size":1129,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ensime:master","ref":"master","sha":"056eea635eb33801b7b8b6fc7e1b12e6c8dad825","user":{"login":"ensime","id":5089042,"avatar_url":"https://avatars.githubusercontent.com/u/5089042?v=3","gravatar_id":"","url":"https://api.github.com/users/ensime","html_url":"https://github.com/ensime","followers_url":"https://api.github.com/users/ensime/followers","following_url":"https://api.github.com/users/ensime/following{/other_user}","gists_url":"https://api.github.com/users/ensime/gists{/gist_id}","starred_url":"https://api.github.com/users/ensime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ensime/subscriptions","organizations_url":"https://api.github.com/users/ensime/orgs","repos_url":"https://api.github.com/users/ensime/repos","events_url":"https://api.github.com/users/ensime/events{/privacy}","received_events_url":"https://api.github.com/users/ensime/received_events","type":"Organization","site_admin":false},"repo":{"id":37286648,"name":"ensime-vim","full_name":"ensime/ensime-vim","owner":{"login":"ensime","id":5089042,"avatar_url":"https://avatars.githubusercontent.com/u/5089042?v=3","gravatar_id":"","url":"https://api.github.com/users/ensime","html_url":"https://github.com/ensime","followers_url":"https://api.github.com/users/ensime/followers","following_url":"https://api.github.com/users/ensime/following{/other_user}","gists_url":"https://api.github.com/users/ensime/gists{/gist_id}","starred_url":"https://api.github.com/users/ensime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ensime/subscriptions","organizations_url":"https://api.github.com/users/ensime/orgs","repos_url":"https://api.github.com/users/ensime/repos","events_url":"https://api.github.com/users/ensime/events{/privacy}","received_events_url":"https://api.github.com/users/ensime/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ensime/ensime-vim","description":"ENSIME for the Editor of the Beast (Vim)","fork":false,"url":"https://api.github.com/repos/ensime/ensime-vim","forks_url":"https://api.github.com/repos/ensime/ensime-vim/forks","keys_url":"https://api.github.com/repos/ensime/ensime-vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ensime/ensime-vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ensime/ensime-vim/teams","hooks_url":"https://api.github.com/repos/ensime/ensime-vim/hooks","issue_events_url":"https://api.github.com/repos/ensime/ensime-vim/issues/events{/number}","events_url":"https://api.github.com/repos/ensime/ensime-vim/events","assignees_url":"https://api.github.com/repos/ensime/ensime-vim/assignees{/user}","branches_url":"https://api.github.com/repos/ensime/ensime-vim/branches{/branch}","tags_url":"https://api.github.com/repos/ensime/ensime-vim/tags","blobs_url":"https://api.github.com/repos/ensime/ensime-vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ensime/ensime-vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ensime/ensime-vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/ensime/ensime-vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ensime/ensime-vim/statuses/{sha}","languages_url":"https://api.github.com/repos/ensime/ensime-vim/languages","stargazers_url":"https://api.github.com/repos/ensime/ensime-vim/stargazers","contributors_url":"https://api.github.com/repos/ensime/ensime-vim/contributors","subscribers_url":"https://api.github.com/repos/ensime/ensime-vim/subscribers","subscription_url":"https://api.github.com/repos/ensime/ensime-vim/subscription","commits_url":"https://api.github.com/repos/ensime/ensime-vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/ensime/ensime-vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/ensime/ensime-vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/ensime/ensime-vim/issues/comments{/number}","contents_url":"https://api.github.com/repos/ensime/ensime-vim/contents/{+path}","compare_url":"https://api.github.com/repos/ensime/ensime-vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ensime/ensime-vim/merges","archive_url":"https://api.github.com/repos/ensime/ensime-vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ensime/ensime-vim/downloads","issues_url":"https://api.github.com/repos/ensime/ensime-vim/issues{/number}","pulls_url":"https://api.github.com/repos/ensime/ensime-vim/pulls{/number}","milestones_url":"https://api.github.com/repos/ensime/ensime-vim/milestones{/number}","notifications_url":"https://api.github.com/repos/ensime/ensime-vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ensime/ensime-vim/labels{/name}","releases_url":"https://api.github.com/repos/ensime/ensime-vim/releases{/id}","deployments_url":"https://api.github.com/repos/ensime/ensime-vim/deployments","created_at":"2015-06-11T21:16:05Z","updated_at":"2016-07-31T14:02:59Z","pushed_at":"2016-08-01T13:57:08Z","git_url":"git://github.com/ensime/ensime-vim.git","ssh_url":"git@github.com:ensime/ensime-vim.git","clone_url":"https://github.com/ensime/ensime-vim.git","svn_url":"https://github.com/ensime/ensime-vim","homepage":null,"size":1183,"stargazers_count":124,"watchers_count":124,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":38,"forks":32,"open_issues":38,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/323"},"html":{"href":"https://github.com/ensime/ensime-vim/pull/323"},"issue":{"href":"https://api.github.com/repos/ensime/ensime-vim/issues/323"},"comments":{"href":"https://api.github.com/repos/ensime/ensime-vim/issues/323/comments"},"review_comments":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/323/comments"},"review_comment":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ensime/ensime-vim/pulls/323/commits"},"statuses":{"href":"https://api.github.com/repos/ensime/ensime-vim/statuses/d5030d7dab9d521f080a9d403984237e1557224c"}}}}
{"actor":{"display_login":"ktonga"}}