{"action":"created","comment":{"url":"https://api.github.com/repos/python-discord/site/pulls/comments/314034182","pull_request_review_id":275087760,"id":314034182,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNDAzNDE4Mg==","diff_hunk":"@@ -0,0 +1,26 @@\n+import logging\n+from datetime import datetime\n+\n+from django.test import TestCase\n+\n+from ..dblogger import DatabaseLogHandler\n+from ..models import LogEntry\n+\n+\n+class DatabaseLogHandlerTests(TestCase):\n+    def test_logs_to_database(self):\n+        logger = logging.getLogger(__file__)\n+        logger.handlers = [DatabaseLogHandler()]\n+        logger.warning(\"I am a test case!\")\n+\n+        # Ensure we only have a single record in the database\n+        # after the logging call above.\n+        [entry] = LogEntry.objects.all()\n+\n+        self.assertEqual(entry.application, 'site')\n+        self.assertEqual(entry.logger_name, __file__)\n+        self.assertIsInstance(entry.timestamp, datetime)\n+        self.assertEqual(entry.level, 'warning')\n+        self.assertEqual(entry.module, 'test_dblogger')","path":"pydis_site/apps/api/tests/test_dblogger.py","position":24,"original_position":24,"commit_id":"6bf05b68a99daefbb7ce38e7f5000c09e4f7f6a2","original_commit_id":"6bf05b68a99daefbb7ce38e7f5000c09e4f7f6a2","user":{"login":"MarkKoz","id":1515135,"node_id":"MDQ6VXNlcjE1MTUxMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1515135?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkKoz","html_url":"https://github.com/MarkKoz","followers_url":"https://api.github.com/users/MarkKoz/followers","following_url":"https://api.github.com/users/MarkKoz/following{/other_user}","gists_url":"https://api.github.com/users/MarkKoz/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkKoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkKoz/subscriptions","organizations_url":"https://api.github.com/users/MarkKoz/orgs","repos_url":"https://api.github.com/users/MarkKoz/repos","events_url":"https://api.github.com/users/MarkKoz/events{/privacy}","received_events_url":"https://api.github.com/users/MarkKoz/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n        self.assertEqual(entry.module, __name__)\r\n```","created_at":"2019-08-14T19:00:08Z","updated_at":"2019-08-14T19:02:22Z","html_url":"https://github.com/python-discord/site/pull/235#discussion_r314034182","pull_request_url":"https://api.github.com/repos/python-discord/site/pulls/235","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/python-discord/site/pulls/comments/314034182"},"html":{"href":"https://github.com/python-discord/site/pull/235#discussion_r314034182"},"pull_request":{"href":"https://api.github.com/repos/python-discord/site/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/python-discord/site/pulls/235","id":307454639,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA3NDU0NjM5","html_url":"https://github.com/python-discord/site/pull/235","diff_url":"https://github.com/python-discord/site/pull/235.diff","patch_url":"https://github.com/python-discord/site/pull/235.patch","issue_url":"https://api.github.com/repos/python-discord/site/issues/235","number":235,"state":"open","locked":false,"title":"log everything into the database in addition to stdout","user":{"login":"jchristgit","id":22679924,"node_id":"MDQ6VXNlcjIyNjc5OTI0","avatar_url":"https://avatars3.githubusercontent.com/u/22679924?v=4","gravatar_id":"","url":"https://api.github.com/users/jchristgit","html_url":"https://github.com/jchristgit","followers_url":"https://api.github.com/users/jchristgit/followers","following_url":"https://api.github.com/users/jchristgit/following{/other_user}","gists_url":"https://api.github.com/users/jchristgit/gists{/gist_id}","starred_url":"https://api.github.com/users/jchristgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchristgit/subscriptions","organizations_url":"https://api.github.com/users/jchristgit/orgs","repos_url":"https://api.github.com/users/jchristgit/repos","events_url":"https://api.github.com/users/jchristgit/events{/privacy}","received_events_url":"https://api.github.com/users/jchristgit/received_events","type":"User","site_admin":false},"body":"wow i managed to write 20 lines of code and it only took 5 months\r\n\r\ncloses #195\r\n\r\n![image](https://user-images.githubusercontent.com/22679924/63047751-58e19100-bed5-11e9-8e8b-a554fb7ffd8a.png)\r\n","created_at":"2019-08-14T18:52:12Z","updated_at":"2019-08-14T19:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33d539c4569533a8cc9e8a79c0852d88c1cd715e","assignee":{"login":"MarkKoz","id":1515135,"node_id":"MDQ6VXNlcjE1MTUxMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1515135?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkKoz","html_url":"https://github.com/MarkKoz","followers_url":"https://api.github.com/users/MarkKoz/followers","following_url":"https://api.github.com/users/MarkKoz/following{/other_user}","gists_url":"https://api.github.com/users/MarkKoz/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkKoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkKoz/subscriptions","organizations_url":"https://api.github.com/users/MarkKoz/orgs","repos_url":"https://api.github.com/users/MarkKoz/repos","events_url":"https://api.github.com/users/MarkKoz/events{/privacy}","received_events_url":"https://api.github.com/users/MarkKoz/received_events","type":"User","site_admin":false},"assignees":[{"login":"MarkKoz","id":1515135,"node_id":"MDQ6VXNlcjE1MTUxMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1515135?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkKoz","html_url":"https://github.com/MarkKoz","followers_url":"https://api.github.com/users/MarkKoz/followers","following_url":"https://api.github.com/users/MarkKoz/following{/other_user}","gists_url":"https://api.github.com/users/MarkKoz/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkKoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkKoz/subscriptions","organizations_url":"https://api.github.com/users/MarkKoz/orgs","repos_url":"https://api.github.com/users/MarkKoz/repos","events_url":"https://api.github.com/users/MarkKoz/events{/privacy}","received_events_url":"https://api.github.com/users/MarkKoz/received_events","type":"User","site_admin":false},{"login":"SebastiaanZ","id":33516116,"node_id":"MDQ6VXNlcjMzNTE2MTE2","avatar_url":"https://avatars0.githubusercontent.com/u/33516116?v=4","gravatar_id":"","url":"https://api.github.com/users/SebastiaanZ","html_url":"https://github.com/SebastiaanZ","followers_url":"https://api.github.com/users/SebastiaanZ/followers","following_url":"https://api.github.com/users/SebastiaanZ/following{/other_user}","gists_url":"https://api.github.com/users/SebastiaanZ/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastiaanZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastiaanZ/subscriptions","organizations_url":"https://api.github.com/users/SebastiaanZ/orgs","repos_url":"https://api.github.com/users/SebastiaanZ/repos","events_url":"https://api.github.com/users/SebastiaanZ/events{/privacy}","received_events_url":"https://api.github.com/users/SebastiaanZ/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"SebastiaanZ","id":33516116,"node_id":"MDQ6VXNlcjMzNTE2MTE2","avatar_url":"https://avatars0.githubusercontent.com/u/33516116?v=4","gravatar_id":"","url":"https://api.github.com/users/SebastiaanZ","html_url":"https://github.com/SebastiaanZ","followers_url":"https://api.github.com/users/SebastiaanZ/followers","following_url":"https://api.github.com/users/SebastiaanZ/following{/other_user}","gists_url":"https://api.github.com/users/SebastiaanZ/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastiaanZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastiaanZ/subscriptions","organizations_url":"https://api.github.com/users/SebastiaanZ/orgs","repos_url":"https://api.github.com/users/SebastiaanZ/repos","events_url":"https://api.github.com/users/SebastiaanZ/events{/privacy}","received_events_url":"https://api.github.com/users/SebastiaanZ/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1130940641,"node_id":"MDU6TGFiZWwxMTMwOTQwNjQx","url":"https://api.github.com/repos/python-discord/site/labels/Backend","name":"Backend","color":"e1e4e9","default":false},{"id":828010902,"node_id":"MDU6TGFiZWw4MjgwMTA5MDI=","url":"https://api.github.com/repos/python-discord/site/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/python-discord/site/pulls/235/commits","review_comments_url":"https://api.github.com/repos/python-discord/site/pulls/235/comments","review_comment_url":"https://api.github.com/repos/python-discord/site/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-discord/site/issues/235/comments","statuses_url":"https://api.github.com/repos/python-discord/site/statuses/6bf05b68a99daefbb7ce38e7f5000c09e4f7f6a2","head":{"label":"python-discord:ouroboros-logging-handler","ref":"ouroboros-logging-handler","sha":"6bf05b68a99daefbb7ce38e7f5000c09e4f7f6a2","user":{"login":"python-discord","id":36101493,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTAxNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/python-discord","html_url":"https://github.com/python-discord","followers_url":"https://api.github.com/users/python-discord/followers","following_url":"https://api.github.com/users/python-discord/following{/other_user}","gists_url":"https://api.github.com/users/python-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/python-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-discord/subscriptions","organizations_url":"https://api.github.com/users/python-discord/orgs","repos_url":"https://api.github.com/users/python-discord/repos","events_url":"https://api.github.com/users/python-discord/events{/privacy}","received_events_url":"https://api.github.com/users/python-discord/received_events","type":"Organization","site_admin":false},"repo":{"id":120370405,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzNzA0MDU=","name":"site","full_name":"python-discord/site","private":false,"owner":{"login":"python-discord","id":36101493,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTAxNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/python-discord","html_url":"https://github.com/python-discord","followers_url":"https://api.github.com/users/python-discord/followers","following_url":"https://api.github.com/users/python-discord/following{/other_user}","gists_url":"https://api.github.com/users/python-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/python-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-discord/subscriptions","organizations_url":"https://api.github.com/users/python-discord/orgs","repos_url":"https://api.github.com/users/python-discord/repos","events_url":"https://api.github.com/users/python-discord/events{/privacy}","received_events_url":"https://api.github.com/users/python-discord/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/python-discord/site","description":"Source code for our website","fork":false,"url":"https://api.github.com/repos/python-discord/site","forks_url":"https://api.github.com/repos/python-discord/site/forks","keys_url":"https://api.github.com/repos/python-discord/site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-discord/site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-discord/site/teams","hooks_url":"https://api.github.com/repos/python-discord/site/hooks","issue_events_url":"https://api.github.com/repos/python-discord/site/issues/events{/number}","events_url":"https://api.github.com/repos/python-discord/site/events","assignees_url":"https://api.github.com/repos/python-discord/site/assignees{/user}","branches_url":"https://api.github.com/repos/python-discord/site/branches{/branch}","tags_url":"https://api.github.com/repos/python-discord/site/tags","blobs_url":"https://api.github.com/repos/python-discord/site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-discord/site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-discord/site/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-discord/site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-discord/site/statuses/{sha}","languages_url":"https://api.github.com/repos/python-discord/site/languages","stargazers_url":"https://api.github.com/repos/python-discord/site/stargazers","contributors_url":"https://api.github.com/repos/python-discord/site/contributors","subscribers_url":"https://api.github.com/repos/python-discord/site/subscribers","subscription_url":"https://api.github.com/repos/python-discord/site/subscription","commits_url":"https://api.github.com/repos/python-discord/site/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-discord/site/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-discord/site/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-discord/site/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-discord/site/contents/{+path}","compare_url":"https://api.github.com/repos/python-discord/site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-discord/site/merges","archive_url":"https://api.github.com/repos/python-discord/site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-discord/site/downloads","issues_url":"https://api.github.com/repos/python-discord/site/issues{/number}","pulls_url":"https://api.github.com/repos/python-discord/site/pulls{/number}","milestones_url":"https://api.github.com/repos/python-discord/site/milestones{/number}","notifications_url":"https://api.github.com/repos/python-discord/site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-discord/site/labels{/name}","releases_url":"https://api.github.com/repos/python-discord/site/releases{/id}","deployments_url":"https://api.github.com/repos/python-discord/site/deployments","created_at":"2018-02-05T22:31:04Z","updated_at":"2019-08-07T20:24:26Z","pushed_at":"2019-08-14T18:52:13Z","git_url":"git://github.com/python-discord/site.git","ssh_url":"git@github.com:python-discord/site.git","clone_url":"https://github.com/python-discord/site.git","svn_url":"https://github.com/python-discord/site","homepage":"https://pythondiscord.com","size":8216,"stargazers_count":556,"watchers_count":556,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":25,"watchers":556,"default_branch":"master"}},"base":{"label":"python-discord:django","ref":"django","sha":"5766439c3b521d9a70f5469ecaa2f4820270ea67","user":{"login":"python-discord","id":36101493,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTAxNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/python-discord","html_url":"https://github.com/python-discord","followers_url":"https://api.github.com/users/python-discord/followers","following_url":"https://api.github.com/users/python-discord/following{/other_user}","gists_url":"https://api.github.com/users/python-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/python-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-discord/subscriptions","organizations_url":"https://api.github.com/users/python-discord/orgs","repos_url":"https://api.github.com/users/python-discord/repos","events_url":"https://api.github.com/users/python-discord/events{/privacy}","received_events_url":"https://api.github.com/users/python-discord/received_events","type":"Organization","site_admin":false},"repo":{"id":120370405,"node_id":"MDEwOlJlcG9zaXRvcnkxMjAzNzA0MDU=","name":"site","full_name":"python-discord/site","private":false,"owner":{"login":"python-discord","id":36101493,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MTAxNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/36101493?v=4","gravatar_id":"","url":"https://api.github.com/users/python-discord","html_url":"https://github.com/python-discord","followers_url":"https://api.github.com/users/python-discord/followers","following_url":"https://api.github.com/users/python-discord/following{/other_user}","gists_url":"https://api.github.com/users/python-discord/gists{/gist_id}","starred_url":"https://api.github.com/users/python-discord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-discord/subscriptions","organizations_url":"https://api.github.com/users/python-discord/orgs","repos_url":"https://api.github.com/users/python-discord/repos","events_url":"https://api.github.com/users/python-discord/events{/privacy}","received_events_url":"https://api.github.com/users/python-discord/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/python-discord/site","description":"Source code for our website","fork":false,"url":"https://api.github.com/repos/python-discord/site","forks_url":"https://api.github.com/repos/python-discord/site/forks","keys_url":"https://api.github.com/repos/python-discord/site/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-discord/site/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-discord/site/teams","hooks_url":"https://api.github.com/repos/python-discord/site/hooks","issue_events_url":"https://api.github.com/repos/python-discord/site/issues/events{/number}","events_url":"https://api.github.com/repos/python-discord/site/events","assignees_url":"https://api.github.com/repos/python-discord/site/assignees{/user}","branches_url":"https://api.github.com/repos/python-discord/site/branches{/branch}","tags_url":"https://api.github.com/repos/python-discord/site/tags","blobs_url":"https://api.github.com/repos/python-discord/site/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-discord/site/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-discord/site/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-discord/site/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-discord/site/statuses/{sha}","languages_url":"https://api.github.com/repos/python-discord/site/languages","stargazers_url":"https://api.github.com/repos/python-discord/site/stargazers","contributors_url":"https://api.github.com/repos/python-discord/site/contributors","subscribers_url":"https://api.github.com/repos/python-discord/site/subscribers","subscription_url":"https://api.github.com/repos/python-discord/site/subscription","commits_url":"https://api.github.com/repos/python-discord/site/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-discord/site/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-discord/site/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-discord/site/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-discord/site/contents/{+path}","compare_url":"https://api.github.com/repos/python-discord/site/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-discord/site/merges","archive_url":"https://api.github.com/repos/python-discord/site/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-discord/site/downloads","issues_url":"https://api.github.com/repos/python-discord/site/issues{/number}","pulls_url":"https://api.github.com/repos/python-discord/site/pulls{/number}","milestones_url":"https://api.github.com/repos/python-discord/site/milestones{/number}","notifications_url":"https://api.github.com/repos/python-discord/site/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-discord/site/labels{/name}","releases_url":"https://api.github.com/repos/python-discord/site/releases{/id}","deployments_url":"https://api.github.com/repos/python-discord/site/deployments","created_at":"2018-02-05T22:31:04Z","updated_at":"2019-08-07T20:24:26Z","pushed_at":"2019-08-14T18:52:13Z","git_url":"git://github.com/python-discord/site.git","ssh_url":"git@github.com:python-discord/site.git","clone_url":"https://github.com/python-discord/site.git","svn_url":"https://github.com/python-discord/site","homepage":"https://pythondiscord.com","size":8216,"stargazers_count":556,"watchers_count":556,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":25,"watchers":556,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-discord/site/pulls/235"},"html":{"href":"https://github.com/python-discord/site/pull/235"},"issue":{"href":"https://api.github.com/repos/python-discord/site/issues/235"},"comments":{"href":"https://api.github.com/repos/python-discord/site/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/python-discord/site/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/python-discord/site/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-discord/site/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/python-discord/site/statuses/6bf05b68a99daefbb7ce38e7f5000c09e4f7f6a2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"MarkKoz"}}