diff --git a/lib/tower.ex b/lib/tower.ex index 50e5793..6864eda 100644 --- a/lib/tower.ex +++ b/lib/tower.ex @@ -5,7 +5,7 @@ defmodule Tower do It tries to do one job well, **handle** error **events** in an elixir application **and inform** configured **reporters** (one or many) about these events. - defmodule MyReporter do + defmodule MyApp.ErrorReporter do @behaviour Tower.Reporter @impl true @@ -14,7 +14,7 @@ defmodule Tower do end end - Application.put_env(:tower, :reporters, [MyReporter]) + Application.put_env(:tower, :reporters, [MyApp.ErrorReporter]) Tower.attach() @@ -22,6 +22,21 @@ defmodule Tower do so that any uncaught exception, uncaught throw or abnormal process exit is handled by Tower and passed along to reporters. + ## Reporters + + You can either write your own reporter or use any amount of the following reporters (separate packages): + + * [tower_email](https://hex.pm/packages/tower_email) ([`TowerEmail.Reporter`](https://hexdocs.pm/tower_email/TowerEmail.Reporter.html)) + * [tower_rollbar](https://hex.pm/packages/tower_rollbar) ([`TowerRollbar.Reporter`](https://hexdocs.pm/tower_rollbar/TowerRollbar.Reporter.html)) + * [tower_slack](https://hex.pm/packages/tower_slack) ([`TowerSlack.Reporter`](https://hexdocs.pm/tower_slack/TowerSlack.Reporter.html)) + + In case you use any of the above reporters, you don't need to explicitly include `tower` package as a dependency. + It should be a transitive dependency of any of the above reporters. + + ### Writing a custom reporter yourself? + + Check out `Tower.Reporter` behvaiour. + ## Manual handling If either, for whatever reason an exception condition is not reaching Tower handling, or you just diff --git a/mix.exs b/mix.exs index 0360c94..9ed26ef 100644 --- a/mix.exs +++ b/mix.exs @@ -69,7 +69,6 @@ defmodule Tower.MixProject do [ main: "Tower", extras: [ - "README.md": [title: "README"], "CHANGELOG.md": [title: "Changelog"] ] ]