{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/pyethereum/pulls/comments/36508480","id":36508480,"diff_hunk":"@@ -138,11 +85,228 @@ def pop_records(self):\n DEFAULT_LOGLEVEL = logging.INFO\n JSON_FORMAT = '%(message)s'\n PRINT_FORMAT = '%(levelname)s:%(name)s\\t%(message)s'\n+#FORMAT = \"%(levelname)s:%(module)s %(asctime)-15s %(message)s\"\n+\n+\n+def get_configuration():\n+    \"\"\"\n+    get a configuration (snapshot) that can be used to call configure\n+    snapshot = get_configuration()\n+    configure(**snapshot)\n+    \"\"\"\n+    rootLogger = getLogger()\n+    name_levels = [('', logging.getLevelName(rootLogger.level))]\n+\n+    for name, logger in list(rootLogger.manager.loggerDict.items()):\n+        name_levels.append((name, logging.getLevelName(logger.level)))\n+    config_string = ','.join('%s:%s' % x for x in name_levels)\n+    #struct_root = get_logger().bind()\n+    #log_json = bool([p for p in struct_root._processors if\n+    #                 isinstance(p, structlog.processors.JSONRenderer)])\n+    return dict(config_string=config_string, log_json=rootLogger.log_json)\n+\n+# helpers\n+known_loggers = set()  # know to structlog (i.e. maybe not yet initialized w/ logging)\n+\n+\n+def get_logger_names():\n+    # logging.Logger.manager.loggerDict.keys() # used ones\n+    # initialized at module load get_logger\n+    return sorted(known_loggers, key=lambda x: '' if not x else x)\n+\n+#----------------------------- from standart logging module width some modifications ----------------------------\n+class ethLogger(logging.Logger):\n+    def __init__(self, name, level=DEFAULT_LOGLEVEL):\n+        super(ethLogger, self).__init__(name, level=level)\n+\n+    def is_active(self, level_name='trace'):\n+        return self.isEnabledFor(logging._checkLevel(level_name.upper()))\n+        #getLogger()\n+        #self.setLevel(getattr(logging, level_name.upper()))\n \n \n+class RootLogger(ethLogger):\n+    \"\"\"\n+    A root logger is not that different to any other logger, except that\n+    it must have a logging level and there is only one instance of it in\n+    the hierarchy.\n+    \"\"\"\n+    def __init__(self, level, log_json=False):\n+        \"\"\"\n+        Initialize the logger with the name \"root\".\n+        \"\"\"\n+        ethLogger.__init__(self, \"root\", level)\n+        self.log_json = False\n+\n+class ethManager(logging.Manager):","path":"ethereum/slogging.py","position":146,"original_position":146,"commit_id":"84e2f5753bf2cd406583cedcb4513c28b517a6bc","original_commit_id":"84e2f5753bf2cd406583cedcb4513c28b517a6bc","user":{"login":"ulope","id":55078,"avatar_url":"https://avatars.githubusercontent.com/u/55078?v=3","gravatar_id":"","url":"https://api.github.com/users/ulope","html_url":"https://github.com/ulope","followers_url":"https://api.github.com/users/ulope/followers","following_url":"https://api.github.com/users/ulope/following{/other_user}","gists_url":"https://api.github.com/users/ulope/gists{/gist_id}","starred_url":"https://api.github.com/users/ulope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulope/subscriptions","organizations_url":"https://api.github.com/users/ulope/orgs","repos_url":"https://api.github.com/users/ulope/repos","events_url":"https://api.github.com/users/ulope/events{/privacy}","received_events_url":"https://api.github.com/users/ulope/received_events","type":"User","site_admin":false},"body":"Class names should start with an upper case letter.","created_at":"2015-08-07T10:47:09Z","updated_at":"2015-08-07T10:47:09Z","html_url":"https://github.com/ethereum/pyethereum/pull/270#discussion_r36508480","pull_request_url":"https://api.github.com/repos/ethereum/pyethereum/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/comments/36508480"},"html":{"href":"https://github.com/ethereum/pyethereum/pull/270#discussion_r36508480"},"pull_request":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/pyethereum/pulls/270","id":41815077,"html_url":"https://github.com/ethereum/pyethereum/pull/270","diff_url":"https://github.com/ethereum/pyethereum/pull/270.diff","patch_url":"https://github.com/ethereum/pyethereum/pull/270.patch","issue_url":"https://api.github.com/repos/ethereum/pyethereum/issues/270","number":270,"state":"open","locked":false,"title":"remove structlog from logging of ethereum","user":{"login":"inzem77","id":931915,"avatar_url":"https://avatars.githubusercontent.com/u/931915?v=3","gravatar_id":"","url":"https://api.github.com/users/inzem77","html_url":"https://github.com/inzem77","followers_url":"https://api.github.com/users/inzem77/followers","following_url":"https://api.github.com/users/inzem77/following{/other_user}","gists_url":"https://api.github.com/users/inzem77/gists{/gist_id}","starred_url":"https://api.github.com/users/inzem77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inzem77/subscriptions","organizations_url":"https://api.github.com/users/inzem77/orgs","repos_url":"https://api.github.com/users/inzem77/repos","events_url":"https://api.github.com/users/inzem77/events{/privacy}","received_events_url":"https://api.github.com/users/inzem77/received_events","type":"User","site_admin":false},"body":"remove structlog from logging of ethereum","created_at":"2015-08-06T17:50:27Z","updated_at":"2015-08-07T10:47:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1354101222da46bc21f96752573ad523177c2ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/pyethereum/pulls/270/commits","review_comments_url":"https://api.github.com/repos/ethereum/pyethereum/pulls/270/comments","review_comment_url":"https://api.github.com/repos/ethereum/pyethereum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/pyethereum/issues/270/comments","statuses_url":"https://api.github.com/repos/ethereum/pyethereum/statuses/84e2f5753bf2cd406583cedcb4513c28b517a6bc","head":{"label":"inzem77:develop","ref":"develop","sha":"84e2f5753bf2cd406583cedcb4513c28b517a6bc","user":{"login":"inzem77","id":931915,"avatar_url":"https://avatars.githubusercontent.com/u/931915?v=3","gravatar_id":"","url":"https://api.github.com/users/inzem77","html_url":"https://github.com/inzem77","followers_url":"https://api.github.com/users/inzem77/followers","following_url":"https://api.github.com/users/inzem77/following{/other_user}","gists_url":"https://api.github.com/users/inzem77/gists{/gist_id}","starred_url":"https://api.github.com/users/inzem77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inzem77/subscriptions","organizations_url":"https://api.github.com/users/inzem77/orgs","repos_url":"https://api.github.com/users/inzem77/repos","events_url":"https://api.github.com/users/inzem77/events{/privacy}","received_events_url":"https://api.github.com/users/inzem77/received_events","type":"User","site_admin":false},"repo":{"id":39516743,"name":"pyethereum","full_name":"inzem77/pyethereum","owner":{"login":"inzem77","id":931915,"avatar_url":"https://avatars.githubusercontent.com/u/931915?v=3","gravatar_id":"","url":"https://api.github.com/users/inzem77","html_url":"https://github.com/inzem77","followers_url":"https://api.github.com/users/inzem77/followers","following_url":"https://api.github.com/users/inzem77/following{/other_user}","gists_url":"https://api.github.com/users/inzem77/gists{/gist_id}","starred_url":"https://api.github.com/users/inzem77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inzem77/subscriptions","organizations_url":"https://api.github.com/users/inzem77/orgs","repos_url":"https://api.github.com/users/inzem77/repos","events_url":"https://api.github.com/users/inzem77/events{/privacy}","received_events_url":"https://api.github.com/users/inzem77/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inzem77/pyethereum","description":"Next generation cryptocurrency network","fork":true,"url":"https://api.github.com/repos/inzem77/pyethereum","forks_url":"https://api.github.com/repos/inzem77/pyethereum/forks","keys_url":"https://api.github.com/repos/inzem77/pyethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inzem77/pyethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inzem77/pyethereum/teams","hooks_url":"https://api.github.com/repos/inzem77/pyethereum/hooks","issue_events_url":"https://api.github.com/repos/inzem77/pyethereum/issues/events{/number}","events_url":"https://api.github.com/repos/inzem77/pyethereum/events","assignees_url":"https://api.github.com/repos/inzem77/pyethereum/assignees{/user}","branches_url":"https://api.github.com/repos/inzem77/pyethereum/branches{/branch}","tags_url":"https://api.github.com/repos/inzem77/pyethereum/tags","blobs_url":"https://api.github.com/repos/inzem77/pyethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inzem77/pyethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inzem77/pyethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/inzem77/pyethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inzem77/pyethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/inzem77/pyethereum/languages","stargazers_url":"https://api.github.com/repos/inzem77/pyethereum/stargazers","contributors_url":"https://api.github.com/repos/inzem77/pyethereum/contributors","subscribers_url":"https://api.github.com/repos/inzem77/pyethereum/subscribers","subscription_url":"https://api.github.com/repos/inzem77/pyethereum/subscription","commits_url":"https://api.github.com/repos/inzem77/pyethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/inzem77/pyethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/inzem77/pyethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/inzem77/pyethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/inzem77/pyethereum/contents/{+path}","compare_url":"https://api.github.com/repos/inzem77/pyethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inzem77/pyethereum/merges","archive_url":"https://api.github.com/repos/inzem77/pyethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inzem77/pyethereum/downloads","issues_url":"https://api.github.com/repos/inzem77/pyethereum/issues{/number}","pulls_url":"https://api.github.com/repos/inzem77/pyethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/inzem77/pyethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/inzem77/pyethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inzem77/pyethereum/labels{/name}","releases_url":"https://api.github.com/repos/inzem77/pyethereum/releases{/id}","created_at":"2015-07-22T16:19:19Z","updated_at":"2015-07-22T16:19:20Z","pushed_at":"2015-08-05T13:05:28Z","git_url":"git://github.com/inzem77/pyethereum.git","ssh_url":"git@github.com:inzem77/pyethereum.git","clone_url":"https://github.com/inzem77/pyethereum.git","svn_url":"https://github.com/inzem77/pyethereum","homepage":null,"size":3255,"stargazers_count":0,"watchers_count":0,"language":"Python","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":0,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"efb08554ee95aa18b08d8f5d21d76097631d2c4a","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15409820,"name":"pyethereum","full_name":"ethereum/pyethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/pyethereum","description":"Next generation cryptocurrency network","fork":false,"url":"https://api.github.com/repos/ethereum/pyethereum","forks_url":"https://api.github.com/repos/ethereum/pyethereum/forks","keys_url":"https://api.github.com/repos/ethereum/pyethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/pyethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/pyethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/pyethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/pyethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/pyethereum/events","assignees_url":"https://api.github.com/repos/ethereum/pyethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/pyethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/pyethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/pyethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/pyethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/pyethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/pyethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/pyethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/pyethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/pyethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/pyethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/pyethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/pyethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/pyethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/pyethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/pyethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/pyethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/pyethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/pyethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/pyethereum/merges","archive_url":"https://api.github.com/repos/ethereum/pyethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/pyethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/pyethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/pyethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/pyethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/pyethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/pyethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/pyethereum/releases{/id}","created_at":"2013-12-24T02:40:05Z","updated_at":"2015-08-06T17:07:11Z","pushed_at":"2015-08-07T04:25:36Z","git_url":"git://github.com/ethereum/pyethereum.git","ssh_url":"git@github.com:ethereum/pyethereum.git","clone_url":"https://github.com/ethereum/pyethereum.git","svn_url":"https://github.com/ethereum/pyethereum","homepage":null,"size":7238,"stargazers_count":329,"watchers_count":329,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":42,"forks":110,"open_issues":42,"watchers":329,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/270"},"html":{"href":"https://github.com/ethereum/pyethereum/pull/270"},"issue":{"href":"https://api.github.com/repos/ethereum/pyethereum/issues/270"},"comments":{"href":"https://api.github.com/repos/ethereum/pyethereum/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/pyethereum/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/pyethereum/statuses/84e2f5753bf2cd406583cedcb4513c28b517a6bc"}}}}