{"action":"created","issue":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1760","labels_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1760/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1760/comments","events_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1760/events","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1760","id":115744293,"number":1760,"title":"Introducing :YcmToggleLogs command","user":{"login":"micbou","id":10026824,"avatar_url":"https://avatars.githubusercontent.com/u/10026824?v=3","gravatar_id":"","url":"https://api.github.com/users/micbou","html_url":"https://github.com/micbou","followers_url":"https://api.github.com/users/micbou/followers","following_url":"https://api.github.com/users/micbou/following{/other_user}","gists_url":"https://api.github.com/users/micbou/gists{/gist_id}","starred_url":"https://api.github.com/users/micbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micbou/subscriptions","organizations_url":"https://api.github.com/users/micbou/orgs","repos_url":"https://api.github.com/users/micbou/repos","events_url":"https://api.github.com/users/micbou/events{/privacy}","received_events_url":"https://api.github.com/users/micbou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-11-08T16:59:24Z","updated_at":"2015-11-17T03:35:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/pulls/1760","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1760","diff_url":"https://github.com/Valloric/YouCompleteMe/pull/1760.diff","patch_url":"https://github.com/Valloric/YouCompleteMe/pull/1760.patch"},"body":"Two approaches were proposed in PR #1753:\r\n- open the stdout and stderr logfiles in Vim windows or close them if already opened: `:YcmToggleLogs`;\r\n- open one of the logfiles in the preview window by specifying it as an argument in the command: `:YcmShowLog <stdout|stderr>`.\r\n\r\nThis PR merges both approaches by adding an optional argument (`Stdout` or `Stderr`) to the first approach. When no argument is given, both logfiles are opened (or closed if already opened).\r\n\r\nWith this approach, we cannot use the preview window because only one such window is allowed by Vim. So, we simulate it by adding properties specific to the preview window (horizontal split, height, etc.)\r\n\r\nSince they are multiple ways to open a file in Vim, I added a generic function `OpenFilename` for this. It makes easy to customize the way logfiles are opened and could be useful for new features.\r\n\r\nTests were a pain to add and I am not sure of the way I implemented them. If someone could review them. There is some refactoring of the Vim mock.\r\n\r\nI updated the documentation and the contribution guidelines. I added a new instruction when creating an issue: adding the output of the `:YcmDebugInfo` command. We often ask it in the issues.\r\n\r\nI suggest fetching the `ycm-toggle-logs` branch of my repository to test yourself this command.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/valloric/youcompleteme/1760)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/comments/157258009","html_url":"https://github.com/Valloric/YouCompleteMe/pull/1760#issuecomment-157258009","issue_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/1760","id":157258009,"user":{"login":"homu","id":10212162,"avatar_url":"https://avatars.githubusercontent.com/u/10212162?v=3","gravatar_id":"","url":"https://api.github.com/users/homu","html_url":"https://github.com/homu","followers_url":"https://api.github.com/users/homu/followers","following_url":"https://api.github.com/users/homu/following{/other_user}","gists_url":"https://api.github.com/users/homu/gists{/gist_id}","starred_url":"https://api.github.com/users/homu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homu/subscriptions","organizations_url":"https://api.github.com/users/homu/orgs","repos_url":"https://api.github.com/users/homu/repos","events_url":"https://api.github.com/users/homu/events{/privacy}","received_events_url":"https://api.github.com/users/homu/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T03:35:38Z","updated_at":"2015-11-17T03:35:38Z","body":":sunny: Test successful - [status](https://travis-ci.org/Valloric/YouCompleteMe/builds/91522677)"}}