{"id":15288004,"url":"https://github.com/jdenen/rexerbug","last_synced_at":"2025-10-20T07:02:09.193Z","repository":{"id":57749688,"uuid":"524732129","full_name":"jdenen/rexerbug","owner":"jdenen","description":"An opinionated wrapper for trace debugging in Elixir","archived":false,"fork":false,"pushed_at":"2022-08-15T13:04:56.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T23:04:09.508Z","etag":null,"topics":["elixir","elixir-lang","tracing"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdenen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-14T17:08:03.000Z","updated_at":"2023-03-22T20:48:20.000Z","dependencies_parsed_at":"2022-08-28T08:52:57.103Z","dependency_job_id":null,"html_url":"https://github.com/jdenen/rexerbug","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdenen%2Frexerbug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdenen%2Frexerbug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdenen%2Frexerbug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdenen%2Frexerbug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdenen","download_url":"https://codeload.github.com/jdenen/rexerbug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248673525,"owners_count":21143512,"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","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":["elixir","elixir-lang","tracing"],"created_at":"2024-09-30T15:43:44.207Z","updated_at":"2025-10-20T07:02:04.174Z","avatar_url":"https://github.com/jdenen.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rexerbug\n\nAn opinionated wrapper for Elixir trace debugging\n\n## What?\n\n[`Rexbug`](https://github.com/nietaki/rexbug) wraps [`:redbug`](https://github.com/massemanet/redbug),\nproviding a more Elixir-like syntax for trace debugging. But `Rexbug` isn't Elixir-y enough for me,\nso I made `Rexerbug` to wrap `Rexbug`.\n\n### Function tracing\n\nInstead of passing a magic string to `Rexbug`, you pass code that will be parsed into a trace.\nFor example:\n\n```elixir\n# Rexerbug\nRexerbug.trace(\u0026Map.new/1)\n\n# Rexbug\nRexbug.start(\"Map.new/1 :: return;stack\")\n\n# redbug\n:redbug.start('\\'Elixir.Map\\':new -\u003e return;stack')\n```\n\nAn installation of `Rexerbug` includes `Rexbug`, so its magic strings will still work.\n\n```elixir\nRexerbug.trace(\"String.starts_with?(_, \\\"a\\\") :: return\")\n```\n\n### Process tracing\n\nWhen tracing processes, `Rexbug` requires a magic list instead of a magic string.\nI wanted to cut all that out and focus on the process to be traced:\n\n```elixir\nmyself = self()\n\nprocess = Process.spawn(fn -\u003e\n  receive do\n    msg -\u003e send(myself, {:got, msg})\n  end\nend)\n\n# Rexerbug\nRexerbug.monitor(process)\n\n# Rexbug\nRexbug.start([:send, :receive], procs: [process])\n```\n\n### Options\n\nI've renamed some options toward more \"expected\" names. These are completely my own bias,\nbut I think they make more sense. Here are the new names compared to the old. Shown values\nare the defaults, which have NOT changed from `Rexbug` to `Rexerbug`:\n\n```elixir\nRexerbug.trace(\n  \u0026Map.new/1,\n  count: 10,\n  timeout: 60_000,\n  pids: :all,\n  connect: Node.self(),\n  arity?: false,\n  buffer?: false,\n  discard?: false\n)\n\nRexbug.start(\n  \"Map.new/1 :: return;stack\",\n  msgs: 10,\n  time: 60_000,\n  procs: :all,\n  target: Node.self(),\n  arity: false,\n  buffered: false,\n  discard: false\n)\n```\n\n### Caveats\n\nBecause my wrapper is opinionated toward how I always use `Rexbug`, it has lost some\nflexibility. A return value of `return;stack` is assumed. Both `:send` and `:receive`\nevents are assumed when `monitor/2`ing a process.\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:rexerbug, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdenen%2Frexerbug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdenen%2Frexerbug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdenen%2Frexerbug/lists"}