{"action":"created","comment":{"url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/comments/232532839","pull_request_review_id":173749192,"id":232532839,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjUzMjgzOQ==","diff_hunk":"@@ -0,0 +1,103 @@\n+package com.example.task01;\n+\n+import java.text.SimpleDateFormat;\n+import java.util.Date;\n+import java.util.HashMap;\n+\n+public class Logger {\n+    private Level level;\n+    private final String name;\n+\n+    public enum Level { DEBUG, INFO, WARNING, ERROR }\n+\n+    private static HashMap<String, Logger> loggers = new HashMap();\n+\n+    public Logger(String name) {\n+        this.name = name;\n+        this.level = Level.DEBUG;\n+    }\n+\n+    public Logger(String name, Level level) {\n+        this.name = name;\n+        this.level = level;\n+    }\n+\n+    public static Logger getLogger(String name) {\n+        if (loggers.containsKey(name)) {\n+            return loggers.get(name);\n+        } else {\n+            Logger logger = new Logger(name);\n+            loggers.put(name, logger);\n+            return logger;\n+        }\n+    }\n+\n+    public void log(Level level, String message) {\n+        if (checkLevel(level)) {\n+            printLog(level, message);\n+        }\n+    }\n+\n+    public void log(Level level, String format, Object... varargs) {\n+        if (checkLevel(level)) {\n+            printLog(level, String.format(format, varargs));\n+        }\n+    }\n+\n+    public void debug(String message) {\n+        if (checkLevel(Level.DEBUG)) {\n+            printLog(Level.DEBUG, message);\n+        }\n+    }\n+\n+    public void debug(String format, Object... varargs) {\n+        if (checkLevel(Level.DEBUG)) {\n+            printLog(Level.DEBUG, String.format(format, varargs));\n+        }\n+    }\n+\n+    public void info(String message) {\n+        if (checkLevel(Level.INFO)) {\n+            printLog(Level.INFO, message);\n+        }\n+    }\n+\n+    public void info(String format, Object... varargs) {\n+        if (checkLevel(Level.INFO)) {\n+            printLog(Level.INFO, String.format(format, varargs));\n+        }\n+    }\n+\n+    public void warning(String message) {\n+        if (checkLevel(Level.WARNING)) {\n+            printLog(Level.WARNING, message);\n+        }\n+    }\n+\n+    public void warning(String format, Object... varargs) {\n+        if (checkLevel(Level.WARNING)) {\n+            printLog(Level.WARNING, String.format(format, varargs));\n+        }\n+    }\n+\n+    public void error(String message) {\n+        printLog(Level.ERROR, message);\n+    }\n+\n+    public void error(String format, Object... varargs) {\n+        printLog(Level.ERROR, String.format(format, varargs));\n+    }\n+\n+    private void printLog(Level level, String message) {\n+        String dateStr = new SimpleDateFormat(\"yyyy.MM.dd hh:mm:ss\").format(new Date());","path":"task01/src/com/example/task01/Logger.java","position":92,"original_position":92,"commit_id":"23fa26914775f43d7cbebf3259a32b9e5695f2f0","original_commit_id":"23fa26914775f43d7cbebf3259a32b9e5695f2f0","user":{"login":"batarelkin","id":11559381,"node_id":"MDQ6VXNlcjExNTU5Mzgx","avatar_url":"https://avatars3.githubusercontent.com/u/11559381?v=4","gravatar_id":"","url":"https://api.github.com/users/batarelkin","html_url":"https://github.com/batarelkin","followers_url":"https://api.github.com/users/batarelkin/followers","following_url":"https://api.github.com/users/batarelkin/following{/other_user}","gists_url":"https://api.github.com/users/batarelkin/gists{/gist_id}","starred_url":"https://api.github.com/users/batarelkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batarelkin/subscriptions","organizations_url":"https://api.github.com/users/batarelkin/orgs","repos_url":"https://api.github.com/users/batarelkin/repos","events_url":"https://api.github.com/users/batarelkin/events{/privacy}","received_events_url":"https://api.github.com/users/batarelkin/received_events","type":"User","site_admin":false},"body":"Каждый раз создавать новый объект `new SimpleDateFormat(\"yyyy.MM.dd hh:mm:ss\")` неэффективно, т.к. происходит анализ строки, что достаточно затратно с точки зрения процессорного времени. Гораздо эффективнее сделать `public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(\"yyyy.MM.dd hh:mm:ss\")` и использовать его.","created_at":"2018-11-12T04:33:00Z","updated_at":"2018-11-12T04:34:23Z","html_url":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2#discussion_r232532839","pull_request_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/comments/232532839"},"html":{"href":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2#discussion_r232532839"},"pull_request":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2","id":224180593,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MTgwNTkz","html_url":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2","diff_url":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2.diff","patch_url":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2.patch","issue_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/2","number":2,"state":"open","locked":false,"title":"Метнёв Вадим. Задание 1","user":{"login":"metnyov","id":35025006,"node_id":"MDQ6VXNlcjM1MDI1MDA2","avatar_url":"https://avatars0.githubusercontent.com/u/35025006?v=4","gravatar_id":"","url":"https://api.github.com/users/metnyov","html_url":"https://github.com/metnyov","followers_url":"https://api.github.com/users/metnyov/followers","following_url":"https://api.github.com/users/metnyov/following{/other_user}","gists_url":"https://api.github.com/users/metnyov/gists{/gist_id}","starred_url":"https://api.github.com/users/metnyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metnyov/subscriptions","organizations_url":"https://api.github.com/users/metnyov/orgs","repos_url":"https://api.github.com/users/metnyov/repos","events_url":"https://api.github.com/users/metnyov/events{/privacy}","received_events_url":"https://api.github.com/users/metnyov/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-19T06:12:13Z","updated_at":"2018-11-12T04:34:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c235d60b3ba62da7e811b43ab39ff023ef16082e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1082232721,"node_id":"MDU6TGFiZWwxMDgyMjMyNzIx","url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/labels/%D0%94%D0%BE%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D1%82%D1%8C","name":"Доработать","color":"e4e669","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2/commits","review_comments_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2/comments","review_comment_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/2/comments","statuses_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/statuses/23fa26914775f43d7cbebf3259a32b9e5695f2f0","head":{"label":"metnyov:task01","ref":"task01","sha":"23fa26914775f43d7cbebf3259a32b9e5695f2f0","user":{"login":"metnyov","id":35025006,"node_id":"MDQ6VXNlcjM1MDI1MDA2","avatar_url":"https://avatars0.githubusercontent.com/u/35025006?v=4","gravatar_id":"","url":"https://api.github.com/users/metnyov","html_url":"https://github.com/metnyov","followers_url":"https://api.github.com/users/metnyov/followers","following_url":"https://api.github.com/users/metnyov/following{/other_user}","gists_url":"https://api.github.com/users/metnyov/gists{/gist_id}","starred_url":"https://api.github.com/users/metnyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metnyov/subscriptions","organizations_url":"https://api.github.com/users/metnyov/orgs","repos_url":"https://api.github.com/users/metnyov/repos","events_url":"https://api.github.com/users/metnyov/events{/privacy}","received_events_url":"https://api.github.com/users/metnyov/received_events","type":"User","site_admin":false},"repo":{"id":153394474,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMzOTQ0NzQ=","name":"5-java-oop-principles","full_name":"metnyov/5-java-oop-principles","private":false,"owner":{"login":"metnyov","id":35025006,"node_id":"MDQ6VXNlcjM1MDI1MDA2","avatar_url":"https://avatars0.githubusercontent.com/u/35025006?v=4","gravatar_id":"","url":"https://api.github.com/users/metnyov","html_url":"https://github.com/metnyov","followers_url":"https://api.github.com/users/metnyov/followers","following_url":"https://api.github.com/users/metnyov/following{/other_user}","gists_url":"https://api.github.com/users/metnyov/gists{/gist_id}","starred_url":"https://api.github.com/users/metnyov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metnyov/subscriptions","organizations_url":"https://api.github.com/users/metnyov/orgs","repos_url":"https://api.github.com/users/metnyov/repos","events_url":"https://api.github.com/users/metnyov/events{/privacy}","received_events_url":"https://api.github.com/users/metnyov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/metnyov/5-java-oop-principles","description":null,"fork":true,"url":"https://api.github.com/repos/metnyov/5-java-oop-principles","forks_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/forks","keys_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/teams","hooks_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/hooks","issue_events_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/issues/events{/number}","events_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/events","assignees_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/assignees{/user}","branches_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/branches{/branch}","tags_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/tags","blobs_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/git/refs{/sha}","trees_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/statuses/{sha}","languages_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/languages","stargazers_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/stargazers","contributors_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/contributors","subscribers_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/subscribers","subscription_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/subscription","commits_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/commits{/sha}","git_commits_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/git/commits{/sha}","comments_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/comments{/number}","issue_comment_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/issues/comments{/number}","contents_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/contents/{+path}","compare_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/merges","archive_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/downloads","issues_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/issues{/number}","pulls_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/pulls{/number}","milestones_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/milestones{/number}","notifications_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/labels{/name}","releases_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/releases{/id}","deployments_url":"https://api.github.com/repos/metnyov/5-java-oop-principles/deployments","created_at":"2018-10-17T04:15:59Z","updated_at":"2018-10-17T04:16:01Z","pushed_at":"2018-10-25T08:35:37Z","git_url":"git://github.com/metnyov/5-java-oop-principles.git","ssh_url":"git@github.com:metnyov/5-java-oop-principles.git","clone_url":"https://github.com/metnyov/5-java-oop-principles.git","svn_url":"https://github.com/metnyov/5-java-oop-principles","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"csu-mk-2018:master","ref":"master","sha":"dba2fc6cc54c9e70ced8a791420c116c3797e4ec","user":{"login":"csu-mk-2018","id":43137869,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTM3ODY5","avatar_url":"https://avatars3.githubusercontent.com/u/43137869?v=4","gravatar_id":"","url":"https://api.github.com/users/csu-mk-2018","html_url":"https://github.com/csu-mk-2018","followers_url":"https://api.github.com/users/csu-mk-2018/followers","following_url":"https://api.github.com/users/csu-mk-2018/following{/other_user}","gists_url":"https://api.github.com/users/csu-mk-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/csu-mk-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csu-mk-2018/subscriptions","organizations_url":"https://api.github.com/users/csu-mk-2018/orgs","repos_url":"https://api.github.com/users/csu-mk-2018/repos","events_url":"https://api.github.com/users/csu-mk-2018/events{/privacy}","received_events_url":"https://api.github.com/users/csu-mk-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":151938074,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE5MzgwNzQ=","name":"5-java-oop-principles","full_name":"csu-mk-2018/5-java-oop-principles","private":false,"owner":{"login":"csu-mk-2018","id":43137869,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMTM3ODY5","avatar_url":"https://avatars3.githubusercontent.com/u/43137869?v=4","gravatar_id":"","url":"https://api.github.com/users/csu-mk-2018","html_url":"https://github.com/csu-mk-2018","followers_url":"https://api.github.com/users/csu-mk-2018/followers","following_url":"https://api.github.com/users/csu-mk-2018/following{/other_user}","gists_url":"https://api.github.com/users/csu-mk-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/csu-mk-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csu-mk-2018/subscriptions","organizations_url":"https://api.github.com/users/csu-mk-2018/orgs","repos_url":"https://api.github.com/users/csu-mk-2018/repos","events_url":"https://api.github.com/users/csu-mk-2018/events{/privacy}","received_events_url":"https://api.github.com/users/csu-mk-2018/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/csu-mk-2018/5-java-oop-principles","description":null,"fork":false,"url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles","forks_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/forks","keys_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/teams","hooks_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/hooks","issue_events_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/events{/number}","events_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/events","assignees_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/assignees{/user}","branches_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/branches{/branch}","tags_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/tags","blobs_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/git/refs{/sha}","trees_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/statuses/{sha}","languages_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/languages","stargazers_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/stargazers","contributors_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/contributors","subscribers_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/subscribers","subscription_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/subscription","commits_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/commits{/sha}","git_commits_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/git/commits{/sha}","comments_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/comments{/number}","issue_comment_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/comments{/number}","contents_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/contents/{+path}","compare_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/merges","archive_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/downloads","issues_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues{/number}","pulls_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls{/number}","milestones_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/milestones{/number}","notifications_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/labels{/name}","releases_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/releases{/id}","deployments_url":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/deployments","created_at":"2018-10-07T12:16:01Z","updated_at":"2018-10-22T06:06:28Z","pushed_at":"2018-11-05T16:11:34Z","git_url":"git://github.com/csu-mk-2018/5-java-oop-principles.git","ssh_url":"git@github.com:csu-mk-2018/5-java-oop-principles.git","clone_url":"https://github.com/csu-mk-2018/5-java-oop-principles.git","svn_url":"https://github.com/csu-mk-2018/5-java-oop-principles","homepage":null,"size":84,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":25,"license":null,"forks":9,"open_issues":25,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2"},"html":{"href":"https://github.com/csu-mk-2018/5-java-oop-principles/pull/2"},"issue":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/2"},"comments":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/csu-mk-2018/5-java-oop-principles/statuses/23fa26914775f43d7cbebf3259a32b9e5695f2f0"}},"author_association":"NONE"}}
{"actor":{"display_login":"batarelkin"}}