{"action":"created","comment":{"url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/comments/86685381","pull_request_review_id":7332032,"id":86685381,"diff_hunk":"@@ -0,0 +1,67 @@\n+package brainfuck;\n+\n+import java.util.stream.Stream;\n+import java.io.IOException;\n+import brainfuck.io.WriteTextFile;\n+\n+/**\n+ * Storing all the data for a proper logging, if the user wanted some.\n+ * @author Julien Lemaire\n+ */\n+public class Logger {\n+\t/**\n+\t * Containing log data.\n+\t */\n+\tprivate StringBuilder data;\n+\n+\t/**\n+\t * Name of the log file.\n+\t */\n+\tprivate String logName;\n+\n+\t/**\n+\t * Main constructor of the <code>Logger</code> class.\n+\t *\n+\t * @param logName\tthe name of the log file.\n+\t * @param data\t\tlog data, as a <code>StringBuilder</code>.\n+\t */\n+\tpublic Logger(String logName, StringBuilder data) {\n+\t\tthis.logName = logName;\n+\t\tthis.data = data;\n+\t}\n+\t\n+\t/**\n+\t * Constructor of the <code>Logger</code> class with empty data.\n+\t *\n+\t * @param logName\tthe name of the log file.\n+\t */\n+\tpublic Logger(String logName) {\n+\t\tthis(logName, new StringBuilder());\n+\t}\n+\n+\t/**\n+\t * Adding a line for data logging.\n+\t *\n+\t * @param line new line to add to logging.\n+\t */\n+\tpublic void add(String line) {\n+\t\tdata.append(line);\n+\t}\n+\n+\t/**\n+\t * Getting for the log data.\n+\t *\n+\t * @return the log data, as a <code>String</code>.\n+\t */\n+\tpublic String getData() {\n+\t\treturn data.toString();\n+\t}\n+\n+\t/**\n+\t * Writing the log file.\n+\t * @throws IOException\tin case writing the file is impossible.\n+\t */\n+\tpublic void write() throws IOException {\n+\t\tnew WriteTextFile(logName).write(data.toString());","path":"src/brainfuck/Logger.java","position":65,"original_position":65,"commit_id":"c16f6ddf10c5d34d8f759b51eb22a3a9e7eaf1aa","original_commit_id":"c16f6ddf10c5d34d8f759b51eb22a3a9e7eaf1aa","user":{"login":"NassimBounouas","id":18635821,"avatar_url":"https://avatars.githubusercontent.com/u/18635821?v=3","gravatar_id":"","url":"https://api.github.com/users/NassimBounouas","html_url":"https://github.com/NassimBounouas","followers_url":"https://api.github.com/users/NassimBounouas/followers","following_url":"https://api.github.com/users/NassimBounouas/following{/other_user}","gists_url":"https://api.github.com/users/NassimBounouas/gists{/gist_id}","starred_url":"https://api.github.com/users/NassimBounouas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NassimBounouas/subscriptions","organizations_url":"https://api.github.com/users/NassimBounouas/orgs","repos_url":"https://api.github.com/users/NassimBounouas/repos","events_url":"https://api.github.com/users/NassimBounouas/events{/privacy}","received_events_url":"https://api.github.com/users/NassimBounouas/received_events","type":"User","site_admin":false},"body":"Are both write and add methods necessary ? WriteTextFile's write method is appending to the file and not overwriting it. Moreover here you can use an attribute WriteTextFile to save an access to your log file and write line per line.","created_at":"2016-11-06T12:34:44Z","updated_at":"2016-11-06T12:34:44Z","html_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47#discussion_r86685381","pull_request_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/comments/86685381"},"html":{"href":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47#discussion_r86685381"},"pull_request":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47","id":92482662,"html_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47","diff_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47.diff","patch_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47.patch","issue_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/47","number":47,"state":"open","locked":false,"title":"Feat/logs","user":{"login":"sticmac","id":10108972,"avatar_url":"https://avatars.githubusercontent.com/u/10108972?v=3","gravatar_id":"","url":"https://api.github.com/users/sticmac","html_url":"https://github.com/sticmac","followers_url":"https://api.github.com/users/sticmac/followers","following_url":"https://api.github.com/users/sticmac/following{/other_user}","gists_url":"https://api.github.com/users/sticmac/gists{/gist_id}","starred_url":"https://api.github.com/users/sticmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sticmac/subscriptions","organizations_url":"https://api.github.com/users/sticmac/orgs","repos_url":"https://api.github.com/users/sticmac/repos","events_url":"https://api.github.com/users/sticmac/events{/privacy}","received_events_url":"https://api.github.com/users/sticmac/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-06T10:13:28Z","updated_at":"2016-11-06T12:34:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c2998f8ca07fe1d5998c8db8f91c8e913d90b35","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47/commits","review_comments_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47/comments","review_comment_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/47/comments","statuses_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/statuses/c16f6ddf10c5d34d8f759b51eb22a3a9e7eaf1aa","head":{"label":"sticmac:feat/logs","ref":"feat/logs","sha":"c16f6ddf10c5d34d8f759b51eb22a3a9e7eaf1aa","user":{"login":"sticmac","id":10108972,"avatar_url":"https://avatars.githubusercontent.com/u/10108972?v=3","gravatar_id":"","url":"https://api.github.com/users/sticmac","html_url":"https://github.com/sticmac","followers_url":"https://api.github.com/users/sticmac/followers","following_url":"https://api.github.com/users/sticmac/following{/other_user}","gists_url":"https://api.github.com/users/sticmac/gists{/gist_id}","starred_url":"https://api.github.com/users/sticmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sticmac/subscriptions","organizations_url":"https://api.github.com/users/sticmac/orgs","repos_url":"https://api.github.com/users/sticmac/repos","events_url":"https://api.github.com/users/sticmac/events{/privacy}","received_events_url":"https://api.github.com/users/sticmac/received_events","type":"User","site_admin":false},"repo":{"id":69457134,"name":"BRAINF-CK_SI3","full_name":"sticmac/BRAINF-CK_SI3","owner":{"login":"sticmac","id":10108972,"avatar_url":"https://avatars.githubusercontent.com/u/10108972?v=3","gravatar_id":"","url":"https://api.github.com/users/sticmac","html_url":"https://github.com/sticmac","followers_url":"https://api.github.com/users/sticmac/followers","following_url":"https://api.github.com/users/sticmac/following{/other_user}","gists_url":"https://api.github.com/users/sticmac/gists{/gist_id}","starred_url":"https://api.github.com/users/sticmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sticmac/subscriptions","organizations_url":"https://api.github.com/users/sticmac/orgs","repos_url":"https://api.github.com/users/sticmac/repos","events_url":"https://api.github.com/users/sticmac/events{/privacy}","received_events_url":"https://api.github.com/users/sticmac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sticmac/BRAINF-CK_SI3","description":null,"fork":true,"url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3","forks_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/forks","keys_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/teams","hooks_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/hooks","issue_events_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/issues/events{/number}","events_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/events","assignees_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/assignees{/user}","branches_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/branches{/branch}","tags_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/tags","blobs_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/git/refs{/sha}","trees_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/statuses/{sha}","languages_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/languages","stargazers_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/stargazers","contributors_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/contributors","subscribers_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/subscribers","subscription_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/subscription","commits_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/commits{/sha}","git_commits_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/git/commits{/sha}","comments_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/comments{/number}","issue_comment_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/issues/comments{/number}","contents_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/contents/{+path}","compare_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/merges","archive_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/downloads","issues_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/issues{/number}","pulls_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/pulls{/number}","milestones_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/milestones{/number}","notifications_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/labels{/name}","releases_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/releases{/id}","deployments_url":"https://api.github.com/repos/sticmac/BRAINF-CK_SI3/deployments","created_at":"2016-09-28T11:36:20Z","updated_at":"2016-09-30T13:41:26Z","pushed_at":"2016-11-06T10:13:08Z","git_url":"git://github.com/sticmac/BRAINF-CK_SI3.git","ssh_url":"git@github.com:sticmac/BRAINF-CK_SI3.git","clone_url":"https://github.com/sticmac/BRAINF-CK_SI3.git","svn_url":"https://github.com/sticmac/BRAINF-CK_SI3","homepage":null,"size":197,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"base":{"label":"MIAOU-Polytech:master","ref":"master","sha":"8c1473ab2429720ba2576facd4068696ae0c14da","user":{"login":"MIAOU-Polytech","id":22497997,"avatar_url":"https://avatars.githubusercontent.com/u/22497997?v=3","gravatar_id":"","url":"https://api.github.com/users/MIAOU-Polytech","html_url":"https://github.com/MIAOU-Polytech","followers_url":"https://api.github.com/users/MIAOU-Polytech/followers","following_url":"https://api.github.com/users/MIAOU-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/MIAOU-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/MIAOU-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MIAOU-Polytech/subscriptions","organizations_url":"https://api.github.com/users/MIAOU-Polytech/orgs","repos_url":"https://api.github.com/users/MIAOU-Polytech/repos","events_url":"https://api.github.com/users/MIAOU-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/MIAOU-Polytech/received_events","type":"Organization","site_admin":false},"repo":{"id":69460342,"name":"BRAINF-CK_SI3","full_name":"MIAOU-Polytech/BRAINF-CK_SI3","owner":{"login":"MIAOU-Polytech","id":22497997,"avatar_url":"https://avatars.githubusercontent.com/u/22497997?v=3","gravatar_id":"","url":"https://api.github.com/users/MIAOU-Polytech","html_url":"https://github.com/MIAOU-Polytech","followers_url":"https://api.github.com/users/MIAOU-Polytech/followers","following_url":"https://api.github.com/users/MIAOU-Polytech/following{/other_user}","gists_url":"https://api.github.com/users/MIAOU-Polytech/gists{/gist_id}","starred_url":"https://api.github.com/users/MIAOU-Polytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MIAOU-Polytech/subscriptions","organizations_url":"https://api.github.com/users/MIAOU-Polytech/orgs","repos_url":"https://api.github.com/users/MIAOU-Polytech/repos","events_url":"https://api.github.com/users/MIAOU-Polytech/events{/privacy}","received_events_url":"https://api.github.com/users/MIAOU-Polytech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3","description":null,"fork":true,"url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3","forks_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/forks","keys_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/teams","hooks_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/hooks","issue_events_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/events{/number}","events_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/events","assignees_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/assignees{/user}","branches_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/branches{/branch}","tags_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/tags","blobs_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/git/refs{/sha}","trees_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/statuses/{sha}","languages_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/languages","stargazers_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/stargazers","contributors_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/contributors","subscribers_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/subscribers","subscription_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/subscription","commits_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/commits{/sha}","git_commits_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/git/commits{/sha}","comments_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/comments{/number}","issue_comment_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/comments{/number}","contents_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/contents/{+path}","compare_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/merges","archive_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/downloads","issues_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues{/number}","pulls_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls{/number}","milestones_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/milestones{/number}","notifications_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/labels{/name}","releases_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/releases{/id}","deployments_url":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/deployments","created_at":"2016-09-28T12:20:54Z","updated_at":"2016-10-25T15:37:27Z","pushed_at":"2016-11-06T10:13:28Z","git_url":"git://github.com/MIAOU-Polytech/BRAINF-CK_SI3.git","ssh_url":"git@github.com:MIAOU-Polytech/BRAINF-CK_SI3.git","clone_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3.git","svn_url":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3","homepage":null,"size":120,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47"},"html":{"href":"https://github.com/MIAOU-Polytech/BRAINF-CK_SI3/pull/47"},"issue":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/47"},"comments":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/MIAOU-Polytech/BRAINF-CK_SI3/statuses/c16f6ddf10c5d34d8f759b51eb22a3a9e7eaf1aa"}}}}
{"actor":{"display_login":"NassimBounouas"}}