https://github.com/ishikawa/plug_hackney_trace
A plug to enable hackney_trace
https://github.com/ishikawa/plug_hackney_trace
elixir elixir-plug
Last synced: 6 months ago
JSON representation
A plug to enable hackney_trace
- Host: GitHub
- URL: https://github.com/ishikawa/plug_hackney_trace
- Owner: ishikawa
- License: mit
- Created: 2018-12-15T16:18:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T11:01:42.000Z (over 7 years ago)
- Last Synced: 2025-09-18T21:50:05.833Z (6 months ago)
- Topics: elixir, elixir-plug
- Language: Elixir
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PlugHackneyTrace
A plug to enable `hackney_trace` in [hackney](https://github.com/benoitc/hackney).
With this plug, you can easily enable `hackney_trace` for your desired controller or the specific action. Furthermore, this plug automatically handles the output of `hackney_trace` and convert it into Elixir `String`. You can log it or handle by your own function.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `plug_hackney_trace` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:plug_hackney_trace, "~> 0.1.0"}
]
end
```
To use it, just plug it into the desired module.
```elixir
plug PlugHackneyTrace, trace: :min
```
In a Phoenix powered project, you can plug it into a specific action.
```elixir
plug PlugHackneyTrace when action in [:show]
```
## License
See [LICENSE](https://github.com/ishikawa/plug_hackney_trace/blob/master/LICENSE) file.