{"action":"created","comment":{"url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/comments/211243324","pull_request_review_id":147620760,"id":211243324,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTI0MzMyNA==","diff_hunk":"@@ -9,62 +9,205 @@ import Foundation\n // logLevel allows you to specify the minimum log level to display messages for.\n // Example:  setting logLevel to .warn will allow .warn and .error log\n // messages to display and prevent .debug and .info messages from displaying.\n-var logLevel: LogLevel = .debug\n+// It can be updated in the debugger by typing `expr logLevel = Log.trace`\n+var logLevel: LogLevel = Log.info","path":"Log.swift","position":6,"original_position":6,"commit_id":"b3c07f538eeaf00cb66326cc900685774fd141e3","original_commit_id":"b3c07f538eeaf00cb66326cc900685774fd141e3","user":{"login":"vlaminck","id":584771,"node_id":"MDQ6VXNlcjU4NDc3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584771?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaminck","html_url":"https://github.com/vlaminck","followers_url":"https://api.github.com/users/vlaminck/followers","following_url":"https://api.github.com/users/vlaminck/following{/other_user}","gists_url":"https://api.github.com/users/vlaminck/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaminck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaminck/subscriptions","organizations_url":"https://api.github.com/users/vlaminck/orgs","repos_url":"https://api.github.com/users/vlaminck/repos","events_url":"https://api.github.com/users/vlaminck/events{/privacy}","received_events_url":"https://api.github.com/users/vlaminck/received_events","type":"User","site_admin":false},"body":"Because I changed `LogLevel` to a protocol, and I'm setting the `Log` enum, I have to leave the `Log` in there. Alternatively, I could make `logLevel` a `Log` instead of a `LogLevel`. I used the protocol in case anyone ever wanted to implement and set their own. That seems unlikely, though.","created_at":"2018-08-20T12:28:40Z","updated_at":"2018-08-20T12:28:40Z","html_url":"https://github.com/SwiftMN/EmojiLogger/pull/5#discussion_r211243324","pull_request_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/comments/211243324"},"html":{"href":"https://github.com/SwiftMN/EmojiLogger/pull/5#discussion_r211243324"},"pull_request":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5"}},"in_reply_to_id":211241127},"pull_request":{"url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5","id":209384714,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Mzg0NzE0","html_url":"https://github.com/SwiftMN/EmojiLogger/pull/5","diff_url":"https://github.com/SwiftMN/EmojiLogger/pull/5.diff","patch_url":"https://github.com/SwiftMN/EmojiLogger/pull/5.patch","issue_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/5","number":5,"state":"open","locked":false,"title":"Refactored to add custom prefixes","user":{"login":"vlaminck","id":584771,"node_id":"MDQ6VXNlcjU4NDc3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584771?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaminck","html_url":"https://github.com/vlaminck","followers_url":"https://api.github.com/users/vlaminck/followers","following_url":"https://api.github.com/users/vlaminck/following{/other_user}","gists_url":"https://api.github.com/users/vlaminck/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaminck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaminck/subscriptions","organizations_url":"https://api.github.com/users/vlaminck/orgs","repos_url":"https://api.github.com/users/vlaminck/repos","events_url":"https://api.github.com/users/vlaminck/events{/privacy}","received_events_url":"https://api.github.com/users/vlaminck/received_events","type":"User","site_admin":false},"body":"# What\r\n\r\nThis is a major refactoring of the internals of `EmojiLogger`. \r\n\r\n* add the ability to add custom prefixes to log messages\r\n    `🐛(\"my message\", self)` \r\n     would output:\r\n    >🐛[DEBUG] [MyClass] my message\r\n* unifies the underlying logic through a single function.\r\n    * removes duplication of logic and risk of differentiation between methods\r\n* removes static functions like `Log.debug(\"my message\")`\r\n    * refactoring everything into the enum removed this possibility. These methods could be rebuilt by renaming the enum or by adding static functions like `debug` or `logDebug`\r\n* add `Loggable` protocol\r\n    * this strips the module name when using `self` as a prefix\r\n* add documentation\r\n\r\n# Why\r\n\r\nI found myself doing things like this a lot \r\n\r\n    🐛(\"[\\(type(of: self))] [\\(#function)] here's a thing: \\(thing)\")\r\n\r\nThis is messy and can be cleaned up like this now\r\n\r\n    🐛(\"here's a thing: \\(thing)\", self, #function)\r\n\r\nIt puts the important information up front which makes it easier to read and understand. \r\n\r\n","created_at":"2018-08-19T23:03:11Z","updated_at":"2018-08-20T12:28:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e918a445f3aacfd41cf2026e4394bc3af4e0fa3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"adamahrens","id":957120,"node_id":"MDQ6VXNlcjk1NzEyMA==","avatar_url":"https://avatars0.githubusercontent.com/u/957120?v=4","gravatar_id":"","url":"https://api.github.com/users/adamahrens","html_url":"https://github.com/adamahrens","followers_url":"https://api.github.com/users/adamahrens/followers","following_url":"https://api.github.com/users/adamahrens/following{/other_user}","gists_url":"https://api.github.com/users/adamahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/adamahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamahrens/subscriptions","organizations_url":"https://api.github.com/users/adamahrens/orgs","repos_url":"https://api.github.com/users/adamahrens/repos","events_url":"https://api.github.com/users/adamahrens/events{/privacy}","received_events_url":"https://api.github.com/users/adamahrens/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5/commits","review_comments_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5/comments","review_comment_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/5/comments","statuses_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/statuses/b3c07f538eeaf00cb66326cc900685774fd141e3","head":{"label":"vlaminck:custom-prefixes","ref":"custom-prefixes","sha":"b3c07f538eeaf00cb66326cc900685774fd141e3","user":{"login":"vlaminck","id":584771,"node_id":"MDQ6VXNlcjU4NDc3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584771?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaminck","html_url":"https://github.com/vlaminck","followers_url":"https://api.github.com/users/vlaminck/followers","following_url":"https://api.github.com/users/vlaminck/following{/other_user}","gists_url":"https://api.github.com/users/vlaminck/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaminck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaminck/subscriptions","organizations_url":"https://api.github.com/users/vlaminck/orgs","repos_url":"https://api.github.com/users/vlaminck/repos","events_url":"https://api.github.com/users/vlaminck/events{/privacy}","received_events_url":"https://api.github.com/users/vlaminck/received_events","type":"User","site_admin":false},"repo":{"id":138339910,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzMzk5MTA=","name":"EmojiLogger","full_name":"vlaminck/EmojiLogger","owner":{"login":"vlaminck","id":584771,"node_id":"MDQ6VXNlcjU4NDc3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/584771?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaminck","html_url":"https://github.com/vlaminck","followers_url":"https://api.github.com/users/vlaminck/followers","following_url":"https://api.github.com/users/vlaminck/following{/other_user}","gists_url":"https://api.github.com/users/vlaminck/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaminck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaminck/subscriptions","organizations_url":"https://api.github.com/users/vlaminck/orgs","repos_url":"https://api.github.com/users/vlaminck/repos","events_url":"https://api.github.com/users/vlaminck/events{/privacy}","received_events_url":"https://api.github.com/users/vlaminck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vlaminck/EmojiLogger","description":"A custom Logger that uses emojis to represent log levels","fork":true,"url":"https://api.github.com/repos/vlaminck/EmojiLogger","forks_url":"https://api.github.com/repos/vlaminck/EmojiLogger/forks","keys_url":"https://api.github.com/repos/vlaminck/EmojiLogger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vlaminck/EmojiLogger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vlaminck/EmojiLogger/teams","hooks_url":"https://api.github.com/repos/vlaminck/EmojiLogger/hooks","issue_events_url":"https://api.github.com/repos/vlaminck/EmojiLogger/issues/events{/number}","events_url":"https://api.github.com/repos/vlaminck/EmojiLogger/events","assignees_url":"https://api.github.com/repos/vlaminck/EmojiLogger/assignees{/user}","branches_url":"https://api.github.com/repos/vlaminck/EmojiLogger/branches{/branch}","tags_url":"https://api.github.com/repos/vlaminck/EmojiLogger/tags","blobs_url":"https://api.github.com/repos/vlaminck/EmojiLogger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vlaminck/EmojiLogger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vlaminck/EmojiLogger/git/refs{/sha}","trees_url":"https://api.github.com/repos/vlaminck/EmojiLogger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vlaminck/EmojiLogger/statuses/{sha}","languages_url":"https://api.github.com/repos/vlaminck/EmojiLogger/languages","stargazers_url":"https://api.github.com/repos/vlaminck/EmojiLogger/stargazers","contributors_url":"https://api.github.com/repos/vlaminck/EmojiLogger/contributors","subscribers_url":"https://api.github.com/repos/vlaminck/EmojiLogger/subscribers","subscription_url":"https://api.github.com/repos/vlaminck/EmojiLogger/subscription","commits_url":"https://api.github.com/repos/vlaminck/EmojiLogger/commits{/sha}","git_commits_url":"https://api.github.com/repos/vlaminck/EmojiLogger/git/commits{/sha}","comments_url":"https://api.github.com/repos/vlaminck/EmojiLogger/comments{/number}","issue_comment_url":"https://api.github.com/repos/vlaminck/EmojiLogger/issues/comments{/number}","contents_url":"https://api.github.com/repos/vlaminck/EmojiLogger/contents/{+path}","compare_url":"https://api.github.com/repos/vlaminck/EmojiLogger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vlaminck/EmojiLogger/merges","archive_url":"https://api.github.com/repos/vlaminck/EmojiLogger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vlaminck/EmojiLogger/downloads","issues_url":"https://api.github.com/repos/vlaminck/EmojiLogger/issues{/number}","pulls_url":"https://api.github.com/repos/vlaminck/EmojiLogger/pulls{/number}","milestones_url":"https://api.github.com/repos/vlaminck/EmojiLogger/milestones{/number}","notifications_url":"https://api.github.com/repos/vlaminck/EmojiLogger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vlaminck/EmojiLogger/labels{/name}","releases_url":"https://api.github.com/repos/vlaminck/EmojiLogger/releases{/id}","deployments_url":"https://api.github.com/repos/vlaminck/EmojiLogger/deployments","created_at":"2018-06-22T19:17:16Z","updated_at":"2018-06-22T19:17:17Z","pushed_at":"2018-08-19T23:09:33Z","git_url":"git://github.com/vlaminck/EmojiLogger.git","ssh_url":"git@github.com:vlaminck/EmojiLogger.git","clone_url":"https://github.com/vlaminck/EmojiLogger.git","svn_url":"https://github.com/vlaminck/EmojiLogger","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SwiftMN:master","ref":"master","sha":"f2279e67898a694a2e3d950cee17dfbcdc15757b","user":{"login":"SwiftMN","id":7798520,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc3OTg1MjA=","avatar_url":"https://avatars3.githubusercontent.com/u/7798520?v=4","gravatar_id":"","url":"https://api.github.com/users/SwiftMN","html_url":"https://github.com/SwiftMN","followers_url":"https://api.github.com/users/SwiftMN/followers","following_url":"https://api.github.com/users/SwiftMN/following{/other_user}","gists_url":"https://api.github.com/users/SwiftMN/gists{/gist_id}","starred_url":"https://api.github.com/users/SwiftMN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwiftMN/subscriptions","organizations_url":"https://api.github.com/users/SwiftMN/orgs","repos_url":"https://api.github.com/users/SwiftMN/repos","events_url":"https://api.github.com/users/SwiftMN/events{/privacy}","received_events_url":"https://api.github.com/users/SwiftMN/received_events","type":"Organization","site_admin":false},"repo":{"id":138319606,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzMTk2MDY=","name":"EmojiLogger","full_name":"SwiftMN/EmojiLogger","owner":{"login":"SwiftMN","id":7798520,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc3OTg1MjA=","avatar_url":"https://avatars3.githubusercontent.com/u/7798520?v=4","gravatar_id":"","url":"https://api.github.com/users/SwiftMN","html_url":"https://github.com/SwiftMN","followers_url":"https://api.github.com/users/SwiftMN/followers","following_url":"https://api.github.com/users/SwiftMN/following{/other_user}","gists_url":"https://api.github.com/users/SwiftMN/gists{/gist_id}","starred_url":"https://api.github.com/users/SwiftMN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwiftMN/subscriptions","organizations_url":"https://api.github.com/users/SwiftMN/orgs","repos_url":"https://api.github.com/users/SwiftMN/repos","events_url":"https://api.github.com/users/SwiftMN/events{/privacy}","received_events_url":"https://api.github.com/users/SwiftMN/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SwiftMN/EmojiLogger","description":"A custom Logger that uses emojis to represent log levels","fork":false,"url":"https://api.github.com/repos/SwiftMN/EmojiLogger","forks_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/forks","keys_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/teams","hooks_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/hooks","issue_events_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/events{/number}","events_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/events","assignees_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/assignees{/user}","branches_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/branches{/branch}","tags_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/tags","blobs_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/git/refs{/sha}","trees_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/statuses/{sha}","languages_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/languages","stargazers_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/stargazers","contributors_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/contributors","subscribers_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/subscribers","subscription_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/subscription","commits_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/commits{/sha}","git_commits_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/git/commits{/sha}","comments_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/comments{/number}","issue_comment_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/comments{/number}","contents_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/contents/{+path}","compare_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/merges","archive_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/downloads","issues_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues{/number}","pulls_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls{/number}","milestones_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/milestones{/number}","notifications_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/labels{/name}","releases_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/releases{/id}","deployments_url":"https://api.github.com/repos/SwiftMN/EmojiLogger/deployments","created_at":"2018-06-22T15:36:10Z","updated_at":"2018-08-19T23:05:52Z","pushed_at":"2018-08-19T23:09:34Z","git_url":"git://github.com/SwiftMN/EmojiLogger.git","ssh_url":"git@github.com:SwiftMN/EmojiLogger.git","clone_url":"https://github.com/SwiftMN/EmojiLogger.git","svn_url":"https://github.com/SwiftMN/EmojiLogger","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5"},"html":{"href":"https://github.com/SwiftMN/EmojiLogger/pull/5"},"issue":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/5"},"comments":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/SwiftMN/EmojiLogger/statuses/b3c07f538eeaf00cb66326cc900685774fd141e3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vlaminck"}}