{"action":"created","comment":{"url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/comments/91094414","pull_request_review_id":11604033,"id":91094414,"diff_hunk":"@@ -0,0 +1,141 @@\n+<?php\n+if ( ! defined( 'ABSPATH' ) ) {\n+\texit; // Exit if accessed directly\n+}\n+\n+if ( ! class_exists( 'WC_Logger' ) ) {\n+\tinclude_once( dirname( dirname( __FILE__ ) ) . '/class-wc-logger.php' );\n+}\n+\n+/**\n+ * Abstract WC Log Handler Class\n+ *\n+ * @version        1.0.0\n+ * @package        WooCommerce/Abstracts\n+ * @category       Abstract Class\n+ * @author         WooThemes\n+ */\n+abstract class WC_Log_Handler {","path":"includes/abstracts/abstract-wc-log-handler.php","position":18,"original_position":18,"commit_id":"ecfc9a0029bebb230819e351c96b4deef0d8da98","original_commit_id":"ecfc9a0029bebb230819e351c96b4deef0d8da98","user":{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"body":"To provide the following functionality by default:\r\n\r\n1. Threshold and level logic. This reason may be invalidated based on [your other question](https://github.com/woocommerce/woocommerce/pull/12340#pullrequestreview-11564598).\r\n1. Provide default message formatting. A simple coherent message format is something most handlers should be able to leverage. For example, both file and email handlers take advantage of default formatting.\r\n1. Provide default timestamp formatting according to [spec](https://tools.ietf.org/html/rfc5424#section-6.2.3).","created_at":"2016-12-06T14:59:50Z","updated_at":"2016-12-06T14:59:50Z","html_url":"https://github.com/woocommerce/woocommerce/pull/12340#discussion_r91094414","pull_request_url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340","_links":{"self":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/comments/91094414"},"html":{"href":"https://github.com/woocommerce/woocommerce/pull/12340#discussion_r91094414"},"pull_request":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340"}}},"pull_request":{"url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340","id":93521529,"html_url":"https://github.com/woocommerce/woocommerce/pull/12340","diff_url":"https://github.com/woocommerce/woocommerce/pull/12340.diff","patch_url":"https://github.com/woocommerce/woocommerce/pull/12340.patch","issue_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/12340","number":12340,"state":"open","locked":false,"title":"Extract log handlers from WC_Logger","user":{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"body":"Implements #10468.\r\n\r\nThis PR adds extension points for `WC_Logger`. Notably the filter `woocommerce_register_log_handlers` is provided to hook up a log handler. The interface has been modified to loosely adhere to the PHP Standards Recommendations [Logger Interface](http://www.php-fig.org/psr/psr-3/). Specifically, logs are now added via `log`, or one of the level helper methods such as `emergency`.\r\n\r\nThe abstract class `WC_Log_Handler` has been provided to facilitate implementing new log handlers.\r\n\r\nA default log handler `WC_Log_Handler_File` is provided. This handler is attached by default via the provided filter.\r\n\r\nThese changes attempt to maintain backwards compatibility, `WC_Logger->add()` now adds an `info` level message and has been deprecated.\r\n\r\nImplementations for email and DB loggers have been provided, as well as an interface for viewing/clearing DB log messages.\r\n\r\nI'd like to get feedback from team members and @gedex. Is this implementation in line with your needs? Does anyone foresee limitations or problems in the direction being taken?","created_at":"2016-11-14T07:52:05Z","updated_at":"2016-12-06T14:59:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e88c4dd33ae50ccb1993bb3a6389f3323d3f15b2","assignee":{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"assignees":[{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340/commits","review_comments_url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340/comments","review_comment_url":"https://api.github.com/repos/woocommerce/woocommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/12340/comments","statuses_url":"https://api.github.com/repos/woocommerce/woocommerce/statuses/ecfc9a0029bebb230819e351c96b4deef0d8da98","head":{"label":"sirreal:develop","ref":"develop","sha":"ecfc9a0029bebb230819e351c96b4deef0d8da98","user":{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"repo":{"id":73418481,"name":"woocommerce","full_name":"sirreal/woocommerce","owner":{"login":"sirreal","id":841763,"avatar_url":"https://avatars.githubusercontent.com/u/841763?v=3","gravatar_id":"","url":"https://api.github.com/users/sirreal","html_url":"https://github.com/sirreal","followers_url":"https://api.github.com/users/sirreal/followers","following_url":"https://api.github.com/users/sirreal/following{/other_user}","gists_url":"https://api.github.com/users/sirreal/gists{/gist_id}","starred_url":"https://api.github.com/users/sirreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirreal/subscriptions","organizations_url":"https://api.github.com/users/sirreal/orgs","repos_url":"https://api.github.com/users/sirreal/repos","events_url":"https://api.github.com/users/sirreal/events{/privacy}","received_events_url":"https://api.github.com/users/sirreal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sirreal/woocommerce","description":"An open source eCommerce plugin for WordPress.","fork":true,"url":"https://api.github.com/repos/sirreal/woocommerce","forks_url":"https://api.github.com/repos/sirreal/woocommerce/forks","keys_url":"https://api.github.com/repos/sirreal/woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sirreal/woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sirreal/woocommerce/teams","hooks_url":"https://api.github.com/repos/sirreal/woocommerce/hooks","issue_events_url":"https://api.github.com/repos/sirreal/woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/sirreal/woocommerce/events","assignees_url":"https://api.github.com/repos/sirreal/woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/sirreal/woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/sirreal/woocommerce/tags","blobs_url":"https://api.github.com/repos/sirreal/woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sirreal/woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sirreal/woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/sirreal/woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sirreal/woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/sirreal/woocommerce/languages","stargazers_url":"https://api.github.com/repos/sirreal/woocommerce/stargazers","contributors_url":"https://api.github.com/repos/sirreal/woocommerce/contributors","subscribers_url":"https://api.github.com/repos/sirreal/woocommerce/subscribers","subscription_url":"https://api.github.com/repos/sirreal/woocommerce/subscription","commits_url":"https://api.github.com/repos/sirreal/woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/sirreal/woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/sirreal/woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/sirreal/woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/sirreal/woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/sirreal/woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sirreal/woocommerce/merges","archive_url":"https://api.github.com/repos/sirreal/woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sirreal/woocommerce/downloads","issues_url":"https://api.github.com/repos/sirreal/woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/sirreal/woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/sirreal/woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/sirreal/woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sirreal/woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/sirreal/woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/sirreal/woocommerce/deployments","created_at":"2016-11-10T20:30:11Z","updated_at":"2016-11-10T20:30:17Z","pushed_at":"2016-12-03T21:44:04Z","git_url":"git://github.com/sirreal/woocommerce.git","ssh_url":"git@github.com:sirreal/woocommerce.git","clone_url":"https://github.com/sirreal/woocommerce.git","svn_url":"https://github.com/sirreal/woocommerce","homepage":"http://www.woocommerce.com/","size":117920,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"master"}},"base":{"label":"woocommerce:master","ref":"master","sha":"b929916190f091f44cd16f8b6a7c2ce17f804ebe","user":{"login":"woocommerce","id":473596,"avatar_url":"https://avatars.githubusercontent.com/u/473596?v=3","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":2179920,"name":"woocommerce","full_name":"woocommerce/woocommerce","owner":{"login":"woocommerce","id":473596,"avatar_url":"https://avatars.githubusercontent.com/u/473596?v=3","gravatar_id":"","url":"https://api.github.com/users/woocommerce","html_url":"https://github.com/woocommerce","followers_url":"https://api.github.com/users/woocommerce/followers","following_url":"https://api.github.com/users/woocommerce/following{/other_user}","gists_url":"https://api.github.com/users/woocommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/woocommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woocommerce/subscriptions","organizations_url":"https://api.github.com/users/woocommerce/orgs","repos_url":"https://api.github.com/users/woocommerce/repos","events_url":"https://api.github.com/users/woocommerce/events{/privacy}","received_events_url":"https://api.github.com/users/woocommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/woocommerce/woocommerce","description":"An open source eCommerce plugin for WordPress.","fork":false,"url":"https://api.github.com/repos/woocommerce/woocommerce","forks_url":"https://api.github.com/repos/woocommerce/woocommerce/forks","keys_url":"https://api.github.com/repos/woocommerce/woocommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/woocommerce/woocommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/woocommerce/woocommerce/teams","hooks_url":"https://api.github.com/repos/woocommerce/woocommerce/hooks","issue_events_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/events{/number}","events_url":"https://api.github.com/repos/woocommerce/woocommerce/events","assignees_url":"https://api.github.com/repos/woocommerce/woocommerce/assignees{/user}","branches_url":"https://api.github.com/repos/woocommerce/woocommerce/branches{/branch}","tags_url":"https://api.github.com/repos/woocommerce/woocommerce/tags","blobs_url":"https://api.github.com/repos/woocommerce/woocommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/woocommerce/woocommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/woocommerce/woocommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/woocommerce/woocommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/woocommerce/woocommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/woocommerce/woocommerce/languages","stargazers_url":"https://api.github.com/repos/woocommerce/woocommerce/stargazers","contributors_url":"https://api.github.com/repos/woocommerce/woocommerce/contributors","subscribers_url":"https://api.github.com/repos/woocommerce/woocommerce/subscribers","subscription_url":"https://api.github.com/repos/woocommerce/woocommerce/subscription","commits_url":"https://api.github.com/repos/woocommerce/woocommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/woocommerce/woocommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/woocommerce/woocommerce/contents/{+path}","compare_url":"https://api.github.com/repos/woocommerce/woocommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/woocommerce/woocommerce/merges","archive_url":"https://api.github.com/repos/woocommerce/woocommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/woocommerce/woocommerce/downloads","issues_url":"https://api.github.com/repos/woocommerce/woocommerce/issues{/number}","pulls_url":"https://api.github.com/repos/woocommerce/woocommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/woocommerce/woocommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/woocommerce/woocommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/woocommerce/woocommerce/labels{/name}","releases_url":"https://api.github.com/repos/woocommerce/woocommerce/releases{/id}","deployments_url":"https://api.github.com/repos/woocommerce/woocommerce/deployments","created_at":"2011-08-09T15:12:11Z","updated_at":"2016-12-05T17:51:25Z","pushed_at":"2016-12-06T12:14:10Z","git_url":"git://github.com/woocommerce/woocommerce.git","ssh_url":"git@github.com:woocommerce/woocommerce.git","clone_url":"https://github.com/woocommerce/woocommerce.git","svn_url":"https://github.com/woocommerce/woocommerce","homepage":"http://www.woocommerce.com/","size":139453,"stargazers_count":3012,"watchers_count":3012,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2556,"mirror_url":null,"open_issues_count":54,"forks":2556,"open_issues":54,"watchers":3012,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340"},"html":{"href":"https://github.com/woocommerce/woocommerce/pull/12340"},"issue":{"href":"https://api.github.com/repos/woocommerce/woocommerce/issues/12340"},"comments":{"href":"https://api.github.com/repos/woocommerce/woocommerce/issues/12340/comments"},"review_comments":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340/comments"},"review_comment":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/woocommerce/woocommerce/pulls/12340/commits"},"statuses":{"href":"https://api.github.com/repos/woocommerce/woocommerce/statuses/ecfc9a0029bebb230819e351c96b4deef0d8da98"}}}}
{"actor":{"display_login":"sirreal"}}