{"action":"created","comment":{"url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/comments/25066931","id":25066931,"diff_hunk":"@@ -36,42 +37,125 @@ public static KeyValueLogger getLogger(Class<?> clazz, String separator) {\n     }    \n     \n     \n+    \n+    @Override\n+    public LogDataBuilder with(String key) {\n+\tif (currentKey == null) {\n+\t    currentKey = new ThreadLocal<String>();\n+\t}\n+\tcurrentKey.set(key);\n+\t\n+\treturn this;\n+    }\n+\n+    @Override\n+    public LogDataConjunction withObject(Object object) {\n+\tString qualifiedName = object.getClass().getName();\n+\tString prefix = qualifiedName.substring(qualifiedName.lastIndexOf(\".\")+1);\n+\t\n+\treturn this.withObject(object, prefix.replaceFirst(new Character(prefix.charAt(0)).toString(), \n+\t\tnew Character(prefix.charAt(0)).toString().toLowerCase()));\n+    }\n+    \n+    @Override\n+    public LogDataConjunction withObject(Object object, String prefix) {\n+\tif (objects == null) {\n+\t    objects = new ThreadLocal<Map<String, Object>>();\n+\t    objects.set(new HashMap<String, Object>());\n+\t}\n+\tobjects.get().put(prefix, object);\n+\treturn this;\n+    }    \n+    \n+    @Override\n+    public LogDataConjunction value(Object value) {\n+\tif (keyValueMap == null) {\n+\t    keyValueMap = new ThreadLocal<Map<String,String>>();\n+\t    keyValueMap.set(new HashMap<String, String>());\n+\t}\n+\tkeyValueMap.get().put(currentKey.get(), value.toString());\n+\treturn this;\n+    }\n+\n+    @Override\n+    public LogDataBuilder and(String key) {\n+\treturn this.with(key);\n+    }\n+\n     @Override\n-    public void log(Priority priority, String message, Object... data) {\n-\tlogger.log(priority, getMessage(message, data));\n+    public LogDataConjunction andObject(Object object) {\n+\treturn this.withObject(object);\n     }\n \n     @Override\n-    public void log(Priority priority, String message, Throwable t, Object... data) {\n-\tlogger.log(priority, getMessage(message, data), t);\n+    public LogDataConjunction andObject(Object object, String prefix) {\n+\treturn this.withObject(object, prefix);\n     }    \n     \n-    private String getMessage(String message, Object... data) {\n-\tif (data == null || data.length == 0)\n+    protected String getFullMessage(String message) {\n+\tif (!hasSerializableData())\n \t    return message;\n \t\n-\treturn message.trim() + \" \" + serialize(data);\n+\tStringBuffer buffer = new StringBuffer(message.trim());","path":"src/main/java/com/vivareal/logger/KeyValueLogger.java","position":109,"original_position":109,"commit_id":"53ea53e0cbf918b3a393ee804cc08c16017339e3","original_commit_id":"53ea53e0cbf918b3a393ee804cc08c16017339e3","user":{"login":"bronx","id":183964,"avatar_url":"https://avatars.githubusercontent.com/u/183964?v=3","gravatar_id":"","url":"https://api.github.com/users/bronx","html_url":"https://github.com/bronx","followers_url":"https://api.github.com/users/bronx/followers","following_url":"https://api.github.com/users/bronx/following{/other_user}","gists_url":"https://api.github.com/users/bronx/gists{/gist_id}","starred_url":"https://api.github.com/users/bronx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronx/subscriptions","organizations_url":"https://api.github.com/users/bronx/orgs","repos_url":"https://api.github.com/users/bronx/repos","events_url":"https://api.github.com/users/bronx/events{/privacy}","received_events_url":"https://api.github.com/users/bronx/received_events","type":"User","site_admin":false},"body":"Agreed.","created_at":"2015-02-20T12:35:13Z","updated_at":"2015-02-20T12:35:13Z","html_url":"https://github.com/VivaReal/vivareal-logger/pull/4#discussion_r25066931","pull_request_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/comments/25066931"},"html":{"href":"https://github.com/VivaReal/vivareal-logger/pull/4#discussion_r25066931"},"pull_request":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4","id":29659799,"html_url":"https://github.com/VivaReal/vivareal-logger/pull/4","diff_url":"https://github.com/VivaReal/vivareal-logger/pull/4.diff","patch_url":"https://github.com/VivaReal/vivareal-logger/pull/4.patch","issue_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/4","number":4,"state":"open","locked":false,"title":"Created fluent interface for logger","user":{"login":"bronx","id":183964,"avatar_url":"https://avatars.githubusercontent.com/u/183964?v=3","gravatar_id":"","url":"https://api.github.com/users/bronx","html_url":"https://github.com/bronx","followers_url":"https://api.github.com/users/bronx/followers","following_url":"https://api.github.com/users/bronx/following{/other_user}","gists_url":"https://api.github.com/users/bronx/gists{/gist_id}","starred_url":"https://api.github.com/users/bronx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronx/subscriptions","organizations_url":"https://api.github.com/users/bronx/orgs","repos_url":"https://api.github.com/users/bronx/repos","events_url":"https://api.github.com/users/bronx/events{/privacy}","received_events_url":"https://api.github.com/users/bronx/received_events","type":"User","site_admin":false},"body":"@nykolaslima ","created_at":"2015-02-19T23:28:16Z","updated_at":"2015-02-20T12:35:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ce03e2a045a547884bf9eac8d53f1a7f872a584","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4/commits","review_comments_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4/comments","review_comment_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/comments/{number}","comments_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/4/comments","statuses_url":"https://api.github.com/repos/VivaReal/vivareal-logger/statuses/53ea53e0cbf918b3a393ee804cc08c16017339e3","head":{"label":"logger-interface","ref":"logger-interface","sha":"53ea53e0cbf918b3a393ee804cc08c16017339e3","user":{"login":"VivaReal","id":1659216,"avatar_url":"https://avatars.githubusercontent.com/u/1659216?v=3","gravatar_id":"","url":"https://api.github.com/users/VivaReal","html_url":"https://github.com/VivaReal","followers_url":"https://api.github.com/users/VivaReal/followers","following_url":"https://api.github.com/users/VivaReal/following{/other_user}","gists_url":"https://api.github.com/users/VivaReal/gists{/gist_id}","starred_url":"https://api.github.com/users/VivaReal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivaReal/subscriptions","organizations_url":"https://api.github.com/users/VivaReal/orgs","repos_url":"https://api.github.com/users/VivaReal/repos","events_url":"https://api.github.com/users/VivaReal/events{/privacy}","received_events_url":"https://api.github.com/users/VivaReal/received_events","type":"Organization","site_admin":false},"repo":{"id":22999542,"name":"vivareal-logger","full_name":"VivaReal/vivareal-logger","owner":{"login":"VivaReal","id":1659216,"avatar_url":"https://avatars.githubusercontent.com/u/1659216?v=3","gravatar_id":"","url":"https://api.github.com/users/VivaReal","html_url":"https://github.com/VivaReal","followers_url":"https://api.github.com/users/VivaReal/followers","following_url":"https://api.github.com/users/VivaReal/following{/other_user}","gists_url":"https://api.github.com/users/VivaReal/gists{/gist_id}","starred_url":"https://api.github.com/users/VivaReal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivaReal/subscriptions","organizations_url":"https://api.github.com/users/VivaReal/orgs","repos_url":"https://api.github.com/users/VivaReal/repos","events_url":"https://api.github.com/users/VivaReal/events{/privacy}","received_events_url":"https://api.github.com/users/VivaReal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VivaReal/vivareal-logger","description":"VivaReal custom logger","fork":false,"url":"https://api.github.com/repos/VivaReal/vivareal-logger","forks_url":"https://api.github.com/repos/VivaReal/vivareal-logger/forks","keys_url":"https://api.github.com/repos/VivaReal/vivareal-logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VivaReal/vivareal-logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VivaReal/vivareal-logger/teams","hooks_url":"https://api.github.com/repos/VivaReal/vivareal-logger/hooks","issue_events_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/events{/number}","events_url":"https://api.github.com/repos/VivaReal/vivareal-logger/events","assignees_url":"https://api.github.com/repos/VivaReal/vivareal-logger/assignees{/user}","branches_url":"https://api.github.com/repos/VivaReal/vivareal-logger/branches{/branch}","tags_url":"https://api.github.com/repos/VivaReal/vivareal-logger/tags","blobs_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VivaReal/vivareal-logger/statuses/{sha}","languages_url":"https://api.github.com/repos/VivaReal/vivareal-logger/languages","stargazers_url":"https://api.github.com/repos/VivaReal/vivareal-logger/stargazers","contributors_url":"https://api.github.com/repos/VivaReal/vivareal-logger/contributors","subscribers_url":"https://api.github.com/repos/VivaReal/vivareal-logger/subscribers","subscription_url":"https://api.github.com/repos/VivaReal/vivareal-logger/subscription","commits_url":"https://api.github.com/repos/VivaReal/vivareal-logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/VivaReal/vivareal-logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/comments/{number}","contents_url":"https://api.github.com/repos/VivaReal/vivareal-logger/contents/{+path}","compare_url":"https://api.github.com/repos/VivaReal/vivareal-logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VivaReal/vivareal-logger/merges","archive_url":"https://api.github.com/repos/VivaReal/vivareal-logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VivaReal/vivareal-logger/downloads","issues_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues{/number}","pulls_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls{/number}","milestones_url":"https://api.github.com/repos/VivaReal/vivareal-logger/milestones{/number}","notifications_url":"https://api.github.com/repos/VivaReal/vivareal-logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VivaReal/vivareal-logger/labels{/name}","releases_url":"https://api.github.com/repos/VivaReal/vivareal-logger/releases{/id}","created_at":"2014-08-15T18:49:02Z","updated_at":"2015-02-03T02:16:12Z","pushed_at":"2015-02-19T23:28:03Z","git_url":"git://github.com/VivaReal/vivareal-logger.git","ssh_url":"git@github.com:VivaReal/vivareal-logger.git","clone_url":"https://github.com/VivaReal/vivareal-logger.git","svn_url":"https://github.com/VivaReal/vivareal-logger","homepage":null,"size":348,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"master","ref":"master","sha":"84d30b8f02e734d13770b80d594507a046b942a0","user":{"login":"VivaReal","id":1659216,"avatar_url":"https://avatars.githubusercontent.com/u/1659216?v=3","gravatar_id":"","url":"https://api.github.com/users/VivaReal","html_url":"https://github.com/VivaReal","followers_url":"https://api.github.com/users/VivaReal/followers","following_url":"https://api.github.com/users/VivaReal/following{/other_user}","gists_url":"https://api.github.com/users/VivaReal/gists{/gist_id}","starred_url":"https://api.github.com/users/VivaReal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivaReal/subscriptions","organizations_url":"https://api.github.com/users/VivaReal/orgs","repos_url":"https://api.github.com/users/VivaReal/repos","events_url":"https://api.github.com/users/VivaReal/events{/privacy}","received_events_url":"https://api.github.com/users/VivaReal/received_events","type":"Organization","site_admin":false},"repo":{"id":22999542,"name":"vivareal-logger","full_name":"VivaReal/vivareal-logger","owner":{"login":"VivaReal","id":1659216,"avatar_url":"https://avatars.githubusercontent.com/u/1659216?v=3","gravatar_id":"","url":"https://api.github.com/users/VivaReal","html_url":"https://github.com/VivaReal","followers_url":"https://api.github.com/users/VivaReal/followers","following_url":"https://api.github.com/users/VivaReal/following{/other_user}","gists_url":"https://api.github.com/users/VivaReal/gists{/gist_id}","starred_url":"https://api.github.com/users/VivaReal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivaReal/subscriptions","organizations_url":"https://api.github.com/users/VivaReal/orgs","repos_url":"https://api.github.com/users/VivaReal/repos","events_url":"https://api.github.com/users/VivaReal/events{/privacy}","received_events_url":"https://api.github.com/users/VivaReal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VivaReal/vivareal-logger","description":"VivaReal custom logger","fork":false,"url":"https://api.github.com/repos/VivaReal/vivareal-logger","forks_url":"https://api.github.com/repos/VivaReal/vivareal-logger/forks","keys_url":"https://api.github.com/repos/VivaReal/vivareal-logger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VivaReal/vivareal-logger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VivaReal/vivareal-logger/teams","hooks_url":"https://api.github.com/repos/VivaReal/vivareal-logger/hooks","issue_events_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/events{/number}","events_url":"https://api.github.com/repos/VivaReal/vivareal-logger/events","assignees_url":"https://api.github.com/repos/VivaReal/vivareal-logger/assignees{/user}","branches_url":"https://api.github.com/repos/VivaReal/vivareal-logger/branches{/branch}","tags_url":"https://api.github.com/repos/VivaReal/vivareal-logger/tags","blobs_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/refs{/sha}","trees_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VivaReal/vivareal-logger/statuses/{sha}","languages_url":"https://api.github.com/repos/VivaReal/vivareal-logger/languages","stargazers_url":"https://api.github.com/repos/VivaReal/vivareal-logger/stargazers","contributors_url":"https://api.github.com/repos/VivaReal/vivareal-logger/contributors","subscribers_url":"https://api.github.com/repos/VivaReal/vivareal-logger/subscribers","subscription_url":"https://api.github.com/repos/VivaReal/vivareal-logger/subscription","commits_url":"https://api.github.com/repos/VivaReal/vivareal-logger/commits{/sha}","git_commits_url":"https://api.github.com/repos/VivaReal/vivareal-logger/git/commits{/sha}","comments_url":"https://api.github.com/repos/VivaReal/vivareal-logger/comments{/number}","issue_comment_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/comments/{number}","contents_url":"https://api.github.com/repos/VivaReal/vivareal-logger/contents/{+path}","compare_url":"https://api.github.com/repos/VivaReal/vivareal-logger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VivaReal/vivareal-logger/merges","archive_url":"https://api.github.com/repos/VivaReal/vivareal-logger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VivaReal/vivareal-logger/downloads","issues_url":"https://api.github.com/repos/VivaReal/vivareal-logger/issues{/number}","pulls_url":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls{/number}","milestones_url":"https://api.github.com/repos/VivaReal/vivareal-logger/milestones{/number}","notifications_url":"https://api.github.com/repos/VivaReal/vivareal-logger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VivaReal/vivareal-logger/labels{/name}","releases_url":"https://api.github.com/repos/VivaReal/vivareal-logger/releases{/id}","created_at":"2014-08-15T18:49:02Z","updated_at":"2015-02-03T02:16:12Z","pushed_at":"2015-02-19T23:28:03Z","git_url":"git://github.com/VivaReal/vivareal-logger.git","ssh_url":"git@github.com:VivaReal/vivareal-logger.git","clone_url":"https://github.com/VivaReal/vivareal-logger.git","svn_url":"https://github.com/VivaReal/vivareal-logger","homepage":null,"size":348,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4"},"html":{"href":"https://github.com/VivaReal/vivareal-logger/pull/4"},"issue":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/4"},"comments":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/VivaReal/vivareal-logger/statuses/53ea53e0cbf918b3a393ee804cc08c16017339e3"}}}}