{"action":"created","comment":{"url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/comments/38138896","id":38138896,"diff_hunk":"@@ -0,0 +1,61 @@\n+# -*- coding: utf-8 -*-\n+\"\"\"\n+MIT license\n+\n+Screen and file logger. Supports print() style arguments and encoded strings.\n+\n+\"\"\"\n+\n+from logging import *\n+\n+def join_args_unicode(*args):\n+    \"\"\"Join arguments as unicode string representations.\"\"\"\n+    args2 = []\n+    for arg in args:\n+        try:\n+            arg = unicode(arg)\n+        except UnicodeDecodeError:\n+            try:\n+                arg = arg.decode(\"utf-8\")\n+            except UnicodeDecodeError:\n+                arg = arg.decode(\"cp1252\")\n+        args2.append(arg)\n+    return \" \".join(args2)\n+\n+class MyLogger(Logger):\n+    \"\"\"Modified logging class to be able to digest several arguments similar to print().\n+Also support encoded strings.\"\"\"\n+    def _log(self, level, msg, args, **kwargs):\n+        msg = join_args_unicode(*((msg,) + args))\n+        args = ()\n+        Logger._log(self, level, msg, args, **kwargs)\n+setLoggerClass(MyLogger)\n+\n+def get_my_logger(name=None, levelConsole=INFO, filename=None, levelFile=DEBUG, clear=False):","path":"lib/mylogging.py","position":34,"original_position":34,"commit_id":"8fb538f951dbcdc62d67e8116bda2ad6ae066ca9","original_commit_id":"8fb538f951dbcdc62d67e8116bda2ad6ae066ca9","user":{"login":"JeremyRand","id":244188,"avatar_url":"https://avatars.githubusercontent.com/u/244188?v=3","gravatar_id":"","url":"https://api.github.com/users/JeremyRand","html_url":"https://github.com/JeremyRand","followers_url":"https://api.github.com/users/JeremyRand/followers","following_url":"https://api.github.com/users/JeremyRand/following{/other_user}","gists_url":"https://api.github.com/users/JeremyRand/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyRand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyRand/subscriptions","organizations_url":"https://api.github.com/users/JeremyRand/orgs","repos_url":"https://api.github.com/users/JeremyRand/repos","events_url":"https://api.github.com/users/JeremyRand/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyRand/received_events","type":"User","site_admin":false},"body":"Wrap at 80 chars?","created_at":"2015-08-27T19:55:59Z","updated_at":"2015-08-27T19:55:59Z","html_url":"https://github.com/namecoin/nmcontrol/pull/96#discussion_r38138896","pull_request_url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96","_links":{"self":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/comments/38138896"},"html":{"href":"https://github.com/namecoin/nmcontrol/pull/96#discussion_r38138896"},"pull_request":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96","id":42836874,"html_url":"https://github.com/namecoin/nmcontrol/pull/96","diff_url":"https://github.com/namecoin/nmcontrol/pull/96.diff","patch_url":"https://github.com/namecoin/nmcontrol/pull/96.patch","issue_url":"https://api.github.com/repos/namecoin/nmcontrol/issues/96","number":96,"state":"open","locked":false,"title":"Logging","user":{"login":"phelixbtc","id":2716236,"avatar_url":"https://avatars.githubusercontent.com/u/2716236?v=3","gravatar_id":"","url":"https://api.github.com/users/phelixbtc","html_url":"https://github.com/phelixbtc","followers_url":"https://api.github.com/users/phelixbtc/followers","following_url":"https://api.github.com/users/phelixbtc/following{/other_user}","gists_url":"https://api.github.com/users/phelixbtc/gists{/gist_id}","starred_url":"https://api.github.com/users/phelixbtc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phelixbtc/subscriptions","organizations_url":"https://api.github.com/users/phelixbtc/orgs","repos_url":"https://api.github.com/users/phelixbtc/repos","events_url":"https://api.github.com/users/phelixbtc/events{/privacy}","received_events_url":"https://api.github.com/users/phelixbtc/received_events","type":"User","site_admin":false},"body":"Replaces all print outputs by parallel output to file and console.\r\n\r\nThis might need some testing.\r\n\r\n","created_at":"2015-08-19T16:44:09Z","updated_at":"2015-08-27T19:55:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96/commits","review_comments_url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96/comments","review_comment_url":"https://api.github.com/repos/namecoin/nmcontrol/pulls/comments{/number}","comments_url":"https://api.github.com/repos/namecoin/nmcontrol/issues/96/comments","statuses_url":"https://api.github.com/repos/namecoin/nmcontrol/statuses/8fb538f951dbcdc62d67e8116bda2ad6ae066ca9","head":{"label":"phelixnmc:logging","ref":"logging","sha":"8fb538f951dbcdc62d67e8116bda2ad6ae066ca9","user":{"login":"phelixnmc","id":5007009,"avatar_url":"https://avatars.githubusercontent.com/u/5007009?v=3","gravatar_id":"","url":"https://api.github.com/users/phelixnmc","html_url":"https://github.com/phelixnmc","followers_url":"https://api.github.com/users/phelixnmc/followers","following_url":"https://api.github.com/users/phelixnmc/following{/other_user}","gists_url":"https://api.github.com/users/phelixnmc/gists{/gist_id}","starred_url":"https://api.github.com/users/phelixnmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phelixnmc/subscriptions","organizations_url":"https://api.github.com/users/phelixnmc/orgs","repos_url":"https://api.github.com/users/phelixnmc/repos","events_url":"https://api.github.com/users/phelixnmc/events{/privacy}","received_events_url":"https://api.github.com/users/phelixnmc/received_events","type":"User","site_admin":false},"repo":{"id":17111034,"name":"nmcontrol","full_name":"phelixnmc/nmcontrol","owner":{"login":"phelixnmc","id":5007009,"avatar_url":"https://avatars.githubusercontent.com/u/5007009?v=3","gravatar_id":"","url":"https://api.github.com/users/phelixnmc","html_url":"https://github.com/phelixnmc","followers_url":"https://api.github.com/users/phelixnmc/followers","following_url":"https://api.github.com/users/phelixnmc/following{/other_user}","gists_url":"https://api.github.com/users/phelixnmc/gists{/gist_id}","starred_url":"https://api.github.com/users/phelixnmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phelixnmc/subscriptions","organizations_url":"https://api.github.com/users/phelixnmc/orgs","repos_url":"https://api.github.com/users/phelixnmc/repos","events_url":"https://api.github.com/users/phelixnmc/events{/privacy}","received_events_url":"https://api.github.com/users/phelixnmc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phelixnmc/nmcontrol","description":"Namecoin Control","fork":true,"url":"https://api.github.com/repos/phelixnmc/nmcontrol","forks_url":"https://api.github.com/repos/phelixnmc/nmcontrol/forks","keys_url":"https://api.github.com/repos/phelixnmc/nmcontrol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phelixnmc/nmcontrol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phelixnmc/nmcontrol/teams","hooks_url":"https://api.github.com/repos/phelixnmc/nmcontrol/hooks","issue_events_url":"https://api.github.com/repos/phelixnmc/nmcontrol/issues/events{/number}","events_url":"https://api.github.com/repos/phelixnmc/nmcontrol/events","assignees_url":"https://api.github.com/repos/phelixnmc/nmcontrol/assignees{/user}","branches_url":"https://api.github.com/repos/phelixnmc/nmcontrol/branches{/branch}","tags_url":"https://api.github.com/repos/phelixnmc/nmcontrol/tags","blobs_url":"https://api.github.com/repos/phelixnmc/nmcontrol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phelixnmc/nmcontrol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phelixnmc/nmcontrol/git/refs{/sha}","trees_url":"https://api.github.com/repos/phelixnmc/nmcontrol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phelixnmc/nmcontrol/statuses/{sha}","languages_url":"https://api.github.com/repos/phelixnmc/nmcontrol/languages","stargazers_url":"https://api.github.com/repos/phelixnmc/nmcontrol/stargazers","contributors_url":"https://api.github.com/repos/phelixnmc/nmcontrol/contributors","subscribers_url":"https://api.github.com/repos/phelixnmc/nmcontrol/subscribers","subscription_url":"https://api.github.com/repos/phelixnmc/nmcontrol/subscription","commits_url":"https://api.github.com/repos/phelixnmc/nmcontrol/commits{/sha}","git_commits_url":"https://api.github.com/repos/phelixnmc/nmcontrol/git/commits{/sha}","comments_url":"https://api.github.com/repos/phelixnmc/nmcontrol/comments{/number}","issue_comment_url":"https://api.github.com/repos/phelixnmc/nmcontrol/issues/comments{/number}","contents_url":"https://api.github.com/repos/phelixnmc/nmcontrol/contents/{+path}","compare_url":"https://api.github.com/repos/phelixnmc/nmcontrol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phelixnmc/nmcontrol/merges","archive_url":"https://api.github.com/repos/phelixnmc/nmcontrol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phelixnmc/nmcontrol/downloads","issues_url":"https://api.github.com/repos/phelixnmc/nmcontrol/issues{/number}","pulls_url":"https://api.github.com/repos/phelixnmc/nmcontrol/pulls{/number}","milestones_url":"https://api.github.com/repos/phelixnmc/nmcontrol/milestones{/number}","notifications_url":"https://api.github.com/repos/phelixnmc/nmcontrol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phelixnmc/nmcontrol/labels{/name}","releases_url":"https://api.github.com/repos/phelixnmc/nmcontrol/releases{/id}","created_at":"2014-02-23T15:57:42Z","updated_at":"2014-06-23T09:23:28Z","pushed_at":"2015-08-27T08:07:24Z","git_url":"git://github.com/phelixnmc/nmcontrol.git","ssh_url":"git@github.com:phelixnmc/nmcontrol.git","clone_url":"https://github.com/phelixnmc/nmcontrol.git","svn_url":"https://github.com/phelixnmc/nmcontrol","homepage":null,"size":567,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"namecoin:master","ref":"master","sha":"8c8382670a5a18c774f504f3318cf4ca2b4e1a75","user":{"login":"namecoin","id":1068524,"avatar_url":"https://avatars.githubusercontent.com/u/1068524?v=3","gravatar_id":"","url":"https://api.github.com/users/namecoin","html_url":"https://github.com/namecoin","followers_url":"https://api.github.com/users/namecoin/followers","following_url":"https://api.github.com/users/namecoin/following{/other_user}","gists_url":"https://api.github.com/users/namecoin/gists{/gist_id}","starred_url":"https://api.github.com/users/namecoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namecoin/subscriptions","organizations_url":"https://api.github.com/users/namecoin/orgs","repos_url":"https://api.github.com/users/namecoin/repos","events_url":"https://api.github.com/users/namecoin/events{/privacy}","received_events_url":"https://api.github.com/users/namecoin/received_events","type":"Organization","site_admin":false},"repo":{"id":15326324,"name":"nmcontrol","full_name":"namecoin/nmcontrol","owner":{"login":"namecoin","id":1068524,"avatar_url":"https://avatars.githubusercontent.com/u/1068524?v=3","gravatar_id":"","url":"https://api.github.com/users/namecoin","html_url":"https://github.com/namecoin","followers_url":"https://api.github.com/users/namecoin/followers","following_url":"https://api.github.com/users/namecoin/following{/other_user}","gists_url":"https://api.github.com/users/namecoin/gists{/gist_id}","starred_url":"https://api.github.com/users/namecoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namecoin/subscriptions","organizations_url":"https://api.github.com/users/namecoin/orgs","repos_url":"https://api.github.com/users/namecoin/repos","events_url":"https://api.github.com/users/namecoin/events{/privacy}","received_events_url":"https://api.github.com/users/namecoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/namecoin/nmcontrol","description":"Namecoin Control.  Pull requests for dns plugin/service please use the dns-dev branch.  End users and everyone else please use the master branch.","fork":true,"url":"https://api.github.com/repos/namecoin/nmcontrol","forks_url":"https://api.github.com/repos/namecoin/nmcontrol/forks","keys_url":"https://api.github.com/repos/namecoin/nmcontrol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/namecoin/nmcontrol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/namecoin/nmcontrol/teams","hooks_url":"https://api.github.com/repos/namecoin/nmcontrol/hooks","issue_events_url":"https://api.github.com/repos/namecoin/nmcontrol/issues/events{/number}","events_url":"https://api.github.com/repos/namecoin/nmcontrol/events","assignees_url":"https://api.github.com/repos/namecoin/nmcontrol/assignees{/user}","branches_url":"https://api.github.com/repos/namecoin/nmcontrol/branches{/branch}","tags_url":"https://api.github.com/repos/namecoin/nmcontrol/tags","blobs_url":"https://api.github.com/repos/namecoin/nmcontrol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/namecoin/nmcontrol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/namecoin/nmcontrol/git/refs{/sha}","trees_url":"https://api.github.com/repos/namecoin/nmcontrol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/namecoin/nmcontrol/statuses/{sha}","languages_url":"https://api.github.com/repos/namecoin/nmcontrol/languages","stargazers_url":"https://api.github.com/repos/namecoin/nmcontrol/stargazers","contributors_url":"https://api.github.com/repos/namecoin/nmcontrol/contributors","subscribers_url":"https://api.github.com/repos/namecoin/nmcontrol/subscribers","subscription_url":"https://api.github.com/repos/namecoin/nmcontrol/subscription","commits_url":"https://api.github.com/repos/namecoin/nmcontrol/commits{/sha}","git_commits_url":"https://api.github.com/repos/namecoin/nmcontrol/git/commits{/sha}","comments_url":"https://api.github.com/repos/namecoin/nmcontrol/comments{/number}","issue_comment_url":"https://api.github.com/repos/namecoin/nmcontrol/issues/comments{/number}","contents_url":"https://api.github.com/repos/namecoin/nmcontrol/contents/{+path}","compare_url":"https://api.github.com/repos/namecoin/nmcontrol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/namecoin/nmcontrol/merges","archive_url":"https://api.github.com/repos/namecoin/nmcontrol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/namecoin/nmcontrol/downloads","issues_url":"https://api.github.com/repos/namecoin/nmcontrol/issues{/number}","pulls_url":"https://api.github.com/repos/namecoin/nmcontrol/pulls{/number}","milestones_url":"https://api.github.com/repos/namecoin/nmcontrol/milestones{/number}","notifications_url":"https://api.github.com/repos/namecoin/nmcontrol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/namecoin/nmcontrol/labels{/name}","releases_url":"https://api.github.com/repos/namecoin/nmcontrol/releases{/id}","created_at":"2013-12-20T00:30:39Z","updated_at":"2015-08-26T00:46:28Z","pushed_at":"2015-08-27T08:07:25Z","git_url":"git://github.com/namecoin/nmcontrol.git","ssh_url":"git@github.com:namecoin/nmcontrol.git","clone_url":"https://github.com/namecoin/nmcontrol.git","svn_url":"https://github.com/namecoin/nmcontrol","homepage":"","size":854,"stargazers_count":38,"watchers_count":38,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":48,"forks":19,"open_issues":48,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96"},"html":{"href":"https://github.com/namecoin/nmcontrol/pull/96"},"issue":{"href":"https://api.github.com/repos/namecoin/nmcontrol/issues/96"},"comments":{"href":"https://api.github.com/repos/namecoin/nmcontrol/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/namecoin/nmcontrol/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/namecoin/nmcontrol/statuses/8fb538f951dbcdc62d67e8116bda2ad6ae066ca9"}}}}