{"id":20491240,"url":"https://github.com/comboy/catcher","last_synced_at":"2025-10-16T09:50:44.743Z","repository":{"id":5275783,"uuid":"6454696","full_name":"comboy/catcher","owner":"comboy","description":"Keep readable logs from your multithreaded ruby scripts","archived":false,"fork":false,"pushed_at":"2015-06-03T17:27:11.000Z","size":132,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-07T14:20:30.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/comboy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-30T09:24:26.000Z","updated_at":"2023-11-14T21:30:04.000Z","dependencies_parsed_at":"2022-07-04T19:30:26.808Z","dependency_job_id":null,"html_url":"https://github.com/comboy/catcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/comboy/catcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fcatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fcatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fcatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fcatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/comboy","download_url":"https://codeload.github.com/comboy/catcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comboy%2Fcatcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279174913,"owners_count":26119356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T17:21:00.341Z","updated_at":"2025-10-16T09:50:44.727Z","avatar_url":"https://github.com/comboy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Catcher\n====\n\nEverytime you create a thread in ruby, you need to add some exception handling to know if something goes wrong (and what exactly went wrong). Same when you do background processing, unless you are already using some bigger framework for this. This gem helps you with that. No fireworks, just makes you write fewer lines to catch and log an exception. \n\nFirst, somewhere in initialization you decide where to log:\n\n    Catcher.setup_logger \"shit_happens.log\"\n\nArguments are the same as for Logger.new. If you don't setup logger it defaults to STDOUT.\n\nThen in your classes:\n\n    class Foo\n      include Catcher::Logger\n\n      def self.bar\n        log.info \"gangnam style\" # wow, this gem is old\n      end\n    end\n\nIt could also be an instance method. It will produce something like this:\n\n    I, [2012-10-30 10:56:45 #20295]  INFO -- : Foo : gangnam style\n\nSo by default you have timestamps (how could you live without them?!), and class name because you don't like to repeat yourself. Now the catching stuff:\n\n    Catcher.block \"I'm gonnna do science here\" do\n      raise \"oops\"\n    end\n\nException gets catched and logged like this:\n\n    E, [2012-10-30 11:00:32 #23305] ERROR -- : Exception raised by 'I'm gonnna do science here'\n      [RuntimeError] oops\n      (irb):3:in `block in irb_binding'\n      /comboy/projects/os/catcher/lib/catcher.rb:9:in `block'\n      (irb):2:in `irb_binding'\n      (.. full backtrace here ..)\n\nAnd finally, for threads, just use:\n\n    Catcher.thread \"doing science\" do\n      # your stuff in a thread\n    end\n\nWhich is equal to Thread.new with Catcher.block inside.\n\nDescription strings in Catcher.block and Catcher.thread are optional, but very much recommended. Comments and suggestions are welome.\n\nHappy threading.\n\nUsage\n------\n\nIn your Gemfile:\n\n    gem 'catcher'\n\nAuthor\n-------\n\nKacper Cieśla (comboy)\n\nLicense\n-------\n\nCatcher is released under the MIT license.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomboy%2Fcatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomboy%2Fcatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomboy%2Fcatcher/lists"}