{"action":"created","comment":{"url":"https://api.github.com/repos/jonmagic/grim/pulls/comments/66782312","id":66782312,"diff_hunk":"@@ -0,0 +1,11 @@\n+require \"logger\"\n+\n+module Grim\n+  class NullLogger < ::Logger","path":"lib/grim/null_logger.rb","position":4,"original_position":4,"commit_id":"13c3f10ddf4efaff91848d1f857013601c4f70cf","original_commit_id":"13c3f10ddf4efaff91848d1f857013601c4f70cf","user":{"login":"jnunemaker","id":235,"avatar_url":"https://avatars.githubusercontent.com/u/235?v=3","gravatar_id":"","url":"https://api.github.com/users/jnunemaker","html_url":"https://github.com/jnunemaker","followers_url":"https://api.github.com/users/jnunemaker/followers","following_url":"https://api.github.com/users/jnunemaker/following{/other_user}","gists_url":"https://api.github.com/users/jnunemaker/gists{/gist_id}","starred_url":"https://api.github.com/users/jnunemaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnunemaker/subscriptions","organizations_url":"https://api.github.com/users/jnunemaker/orgs","repos_url":"https://api.github.com/users/jnunemaker/repos","events_url":"https://api.github.com/users/jnunemaker/events{/privacy}","received_events_url":"https://api.github.com/users/jnunemaker/received_events","type":"User","site_admin":true},"body":"Personally, I wouldn't inherit from logger. I'd just have null logger and define the debug method (and info if that is used anywhere). ","created_at":"2016-06-13T12:24:20Z","updated_at":"2016-06-13T12:24:20Z","html_url":"https://github.com/jonmagic/grim/pull/29#discussion_r66782312","pull_request_url":"https://api.github.com/repos/jonmagic/grim/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/comments/66782312"},"html":{"href":"https://github.com/jonmagic/grim/pull/29#discussion_r66782312"},"pull_request":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/jonmagic/grim/pulls/29","id":73324970,"html_url":"https://github.com/jonmagic/grim/pull/29","diff_url":"https://github.com/jonmagic/grim/pull/29.diff","patch_url":"https://github.com/jonmagic/grim/pull/29.patch","issue_url":"https://api.github.com/repos/jonmagic/grim/issues/29","number":29,"state":"open","locked":false,"title":"Add Grim.logger","user":{"login":"jonmagic","id":623,"avatar_url":"https://avatars.githubusercontent.com/u/623?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmagic","html_url":"https://github.com/jonmagic","followers_url":"https://api.github.com/users/jonmagic/followers","following_url":"https://api.github.com/users/jonmagic/following{/other_user}","gists_url":"https://api.github.com/users/jonmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmagic/subscriptions","organizations_url":"https://api.github.com/users/jonmagic/orgs","repos_url":"https://api.github.com/users/jonmagic/repos","events_url":"https://api.github.com/users/jonmagic/events{/privacy}","received_events_url":"https://api.github.com/users/jonmagic/received_events","type":"User","site_admin":true},"body":"This PR adds the ability to set a logger on Grim. It now logs the `imagemagick` and `pdftotext` commands before it runs them. For the `imagemagick` command it also logs the command env if the env is being modified.\r\n\r\nThe default logger is `Grim::NullLogger` but you can also set your own logger.\r\n\r\n```ruby\r\nrequire \"logger\"\r\nGrim.logger = Logger.new($stdout).tap { |logger| logger.progname = 'Grim' }\r\nGrim.processor = Grim::ImageMagickProcessor.new({:ghostscript_path => \"/path/to/bin/gs\"})\r\npdf = Grim.reap(\"/path/to/pdf\")\r\npdf[3].save('/path/to/image.png')\r\n# D, [2016-06-09T22:43:07.046532 #69344] DEBUG -- grim: Running imagemagick command\r\n# D, [2016-06-09T22:43:07.046626 #69344] DEBUG -- grim: PATH=/path/to/bin:/usr/local/bin:/usr/bin\r\n# D, [2016-06-09T22:43:07.046787 #69344] DEBUG -- grim: convert -resize 1024 -antialias -render -quality 90 -colorspace RGB -interlace none -density 300 /path/to/pdf /path/to/image.png\r\n```\r\n\r\nThis should help folks with diagnosing https://github.com/jonmagic/grim/issues/28","created_at":"2016-06-10T05:56:48Z","updated_at":"2016-06-13T12:24:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4555c96fb147165446b94fbc1a4e2f67c082600","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jonmagic/grim/pulls/29/commits","review_comments_url":"https://api.github.com/repos/jonmagic/grim/pulls/29/comments","review_comment_url":"https://api.github.com/repos/jonmagic/grim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jonmagic/grim/issues/29/comments","statuses_url":"https://api.github.com/repos/jonmagic/grim/statuses/13c3f10ddf4efaff91848d1f857013601c4f70cf","head":{"label":"jonmagic:logging","ref":"logging","sha":"13c3f10ddf4efaff91848d1f857013601c4f70cf","user":{"login":"jonmagic","id":623,"avatar_url":"https://avatars.githubusercontent.com/u/623?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmagic","html_url":"https://github.com/jonmagic","followers_url":"https://api.github.com/users/jonmagic/followers","following_url":"https://api.github.com/users/jonmagic/following{/other_user}","gists_url":"https://api.github.com/users/jonmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmagic/subscriptions","organizations_url":"https://api.github.com/users/jonmagic/orgs","repos_url":"https://api.github.com/users/jonmagic/repos","events_url":"https://api.github.com/users/jonmagic/events{/privacy}","received_events_url":"https://api.github.com/users/jonmagic/received_events","type":"User","site_admin":true},"repo":{"id":2330620,"name":"grim","full_name":"jonmagic/grim","owner":{"login":"jonmagic","id":623,"avatar_url":"https://avatars.githubusercontent.com/u/623?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmagic","html_url":"https://github.com/jonmagic","followers_url":"https://api.github.com/users/jonmagic/followers","following_url":"https://api.github.com/users/jonmagic/following{/other_user}","gists_url":"https://api.github.com/users/jonmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmagic/subscriptions","organizations_url":"https://api.github.com/users/jonmagic/orgs","repos_url":"https://api.github.com/users/jonmagic/repos","events_url":"https://api.github.com/users/jonmagic/events{/privacy}","received_events_url":"https://api.github.com/users/jonmagic/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/jonmagic/grim","description":"Tool for extracting pages from pdf as images and text as strings.","fork":false,"url":"https://api.github.com/repos/jonmagic/grim","forks_url":"https://api.github.com/repos/jonmagic/grim/forks","keys_url":"https://api.github.com/repos/jonmagic/grim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonmagic/grim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonmagic/grim/teams","hooks_url":"https://api.github.com/repos/jonmagic/grim/hooks","issue_events_url":"https://api.github.com/repos/jonmagic/grim/issues/events{/number}","events_url":"https://api.github.com/repos/jonmagic/grim/events","assignees_url":"https://api.github.com/repos/jonmagic/grim/assignees{/user}","branches_url":"https://api.github.com/repos/jonmagic/grim/branches{/branch}","tags_url":"https://api.github.com/repos/jonmagic/grim/tags","blobs_url":"https://api.github.com/repos/jonmagic/grim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonmagic/grim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonmagic/grim/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonmagic/grim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonmagic/grim/statuses/{sha}","languages_url":"https://api.github.com/repos/jonmagic/grim/languages","stargazers_url":"https://api.github.com/repos/jonmagic/grim/stargazers","contributors_url":"https://api.github.com/repos/jonmagic/grim/contributors","subscribers_url":"https://api.github.com/repos/jonmagic/grim/subscribers","subscription_url":"https://api.github.com/repos/jonmagic/grim/subscription","commits_url":"https://api.github.com/repos/jonmagic/grim/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonmagic/grim/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonmagic/grim/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonmagic/grim/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonmagic/grim/contents/{+path}","compare_url":"https://api.github.com/repos/jonmagic/grim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonmagic/grim/merges","archive_url":"https://api.github.com/repos/jonmagic/grim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonmagic/grim/downloads","issues_url":"https://api.github.com/repos/jonmagic/grim/issues{/number}","pulls_url":"https://api.github.com/repos/jonmagic/grim/pulls{/number}","milestones_url":"https://api.github.com/repos/jonmagic/grim/milestones{/number}","notifications_url":"https://api.github.com/repos/jonmagic/grim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonmagic/grim/labels{/name}","releases_url":"https://api.github.com/repos/jonmagic/grim/releases{/id}","deployments_url":"https://api.github.com/repos/jonmagic/grim/deployments","created_at":"2011-09-05T20:49:58Z","updated_at":"2016-06-07T18:06:06Z","pushed_at":"2016-06-10T05:56:48Z","git_url":"git://github.com/jonmagic/grim.git","ssh_url":"git@github.com:jonmagic/grim.git","clone_url":"https://github.com/jonmagic/grim.git","svn_url":"https://github.com/jonmagic/grim","homepage":"","size":796,"stargazers_count":144,"watchers_count":144,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":2,"forks":40,"open_issues":2,"watchers":144,"default_branch":"master"}},"base":{"label":"jonmagic:master","ref":"master","sha":"6b8a8e1f259583d008326858b066b5046adec8ec","user":{"login":"jonmagic","id":623,"avatar_url":"https://avatars.githubusercontent.com/u/623?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmagic","html_url":"https://github.com/jonmagic","followers_url":"https://api.github.com/users/jonmagic/followers","following_url":"https://api.github.com/users/jonmagic/following{/other_user}","gists_url":"https://api.github.com/users/jonmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmagic/subscriptions","organizations_url":"https://api.github.com/users/jonmagic/orgs","repos_url":"https://api.github.com/users/jonmagic/repos","events_url":"https://api.github.com/users/jonmagic/events{/privacy}","received_events_url":"https://api.github.com/users/jonmagic/received_events","type":"User","site_admin":true},"repo":{"id":2330620,"name":"grim","full_name":"jonmagic/grim","owner":{"login":"jonmagic","id":623,"avatar_url":"https://avatars.githubusercontent.com/u/623?v=3","gravatar_id":"","url":"https://api.github.com/users/jonmagic","html_url":"https://github.com/jonmagic","followers_url":"https://api.github.com/users/jonmagic/followers","following_url":"https://api.github.com/users/jonmagic/following{/other_user}","gists_url":"https://api.github.com/users/jonmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmagic/subscriptions","organizations_url":"https://api.github.com/users/jonmagic/orgs","repos_url":"https://api.github.com/users/jonmagic/repos","events_url":"https://api.github.com/users/jonmagic/events{/privacy}","received_events_url":"https://api.github.com/users/jonmagic/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/jonmagic/grim","description":"Tool for extracting pages from pdf as images and text as strings.","fork":false,"url":"https://api.github.com/repos/jonmagic/grim","forks_url":"https://api.github.com/repos/jonmagic/grim/forks","keys_url":"https://api.github.com/repos/jonmagic/grim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonmagic/grim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonmagic/grim/teams","hooks_url":"https://api.github.com/repos/jonmagic/grim/hooks","issue_events_url":"https://api.github.com/repos/jonmagic/grim/issues/events{/number}","events_url":"https://api.github.com/repos/jonmagic/grim/events","assignees_url":"https://api.github.com/repos/jonmagic/grim/assignees{/user}","branches_url":"https://api.github.com/repos/jonmagic/grim/branches{/branch}","tags_url":"https://api.github.com/repos/jonmagic/grim/tags","blobs_url":"https://api.github.com/repos/jonmagic/grim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonmagic/grim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonmagic/grim/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonmagic/grim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonmagic/grim/statuses/{sha}","languages_url":"https://api.github.com/repos/jonmagic/grim/languages","stargazers_url":"https://api.github.com/repos/jonmagic/grim/stargazers","contributors_url":"https://api.github.com/repos/jonmagic/grim/contributors","subscribers_url":"https://api.github.com/repos/jonmagic/grim/subscribers","subscription_url":"https://api.github.com/repos/jonmagic/grim/subscription","commits_url":"https://api.github.com/repos/jonmagic/grim/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonmagic/grim/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonmagic/grim/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonmagic/grim/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonmagic/grim/contents/{+path}","compare_url":"https://api.github.com/repos/jonmagic/grim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonmagic/grim/merges","archive_url":"https://api.github.com/repos/jonmagic/grim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonmagic/grim/downloads","issues_url":"https://api.github.com/repos/jonmagic/grim/issues{/number}","pulls_url":"https://api.github.com/repos/jonmagic/grim/pulls{/number}","milestones_url":"https://api.github.com/repos/jonmagic/grim/milestones{/number}","notifications_url":"https://api.github.com/repos/jonmagic/grim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonmagic/grim/labels{/name}","releases_url":"https://api.github.com/repos/jonmagic/grim/releases{/id}","deployments_url":"https://api.github.com/repos/jonmagic/grim/deployments","created_at":"2011-09-05T20:49:58Z","updated_at":"2016-06-07T18:06:06Z","pushed_at":"2016-06-10T05:56:48Z","git_url":"git://github.com/jonmagic/grim.git","ssh_url":"git@github.com:jonmagic/grim.git","clone_url":"https://github.com/jonmagic/grim.git","svn_url":"https://github.com/jonmagic/grim","homepage":"","size":796,"stargazers_count":144,"watchers_count":144,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":2,"forks":40,"open_issues":2,"watchers":144,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/29"},"html":{"href":"https://github.com/jonmagic/grim/pull/29"},"issue":{"href":"https://api.github.com/repos/jonmagic/grim/issues/29"},"comments":{"href":"https://api.github.com/repos/jonmagic/grim/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jonmagic/grim/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/jonmagic/grim/statuses/13c3f10ddf4efaff91848d1f857013601c4f70cf"}}}}
{"actor":{"display_login":"jnunemaker"}}