# `GitHoox.Logger`
[🔗](https://github.com/sgerrand/git_hoox/blob/v0.5.0/lib/git_hoox/logger.ex#L1)

Reference `:telemetry` handler that logs GitHoox events via `Logger`.

Attach during application start or before invoking hooks:

    GitHoox.Logger.attach()

Detach with `GitHoox.Logger.detach/0`. The handler is opt-in; GitHoox does
not attach it for you.

Log lines look like:

    [git_hoox] pre_commit → ok (2 hooks, 3 files, 240ms)
    [git_hoox]   GitHoox.Hooks.Format → ok (240ms)
    [git_hoox]   GitHoox.Hooks.Credo → error (1.5s) reason: {1, "..."}

Levels:

  * stage events log at `:info` on success and `:warning` on failure
  * hook events log at `:debug` on success/skip and `:warning` on failure

# `attach`

```elixir
@spec attach() :: :ok | {:error, :already_exists}
```

Attach the handler.

# `detach`

```elixir
@spec detach() :: :ok | {:error, :not_found}
```

Detach the handler. Safe to call when not attached.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
