Skip to content

Commit

Permalink
Add usage to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tashirosota committed Jan 4, 2022
1 parent 02f908d commit 0bd9b63
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Changelog

## v0.1.1 (2022-1-4)

- Add usage to readme.

## v0.1.0 (2022-1-3)

- Initial release
- Initial release.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- @format -->

[![hex.pm version](https://img.shields.io/hexpm/v/ltsv.svg)](https://hex.pm/packages/stacktrace_cleaner)
[![CI](https://github.com/tashirosota/magical_make/actions/workflows/ci.yml/badge.svg)](https://github.com/tashirosota/magical_make/actions/workflows/ci.yml)
[![CI](https://github.com/tashirosota/magical_make/actions/workflows/ci.yml/badge.svg)](https://github.com/tashirosota/stacktrace_cleaner/actions/workflows/ci.yml)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tashirosota/stacktrace_cleaner)

# StacktraceCleaner
Expand All @@ -16,7 +16,7 @@ Inspired by [`ActiveSupport::BacktraceCleaner`](https://github.com/rails/rails/b
```elixir
def deps do
[
{:stacktrace_cleaner, "~> 0.1.0"}
{:stacktrace_cleaner, "~> 0.1.1"}
]
end
```
Expand All @@ -26,18 +26,31 @@ end
**[docs](https://hexdocs.pm/stacktrace_cleaner)**

```elixir
StacktraceCleaner.current_stacktrace
=> {StacktraceCleaner, :current_stacktraces, 1, [file: 'lib/stacktrace_cleaner.ex', line: 26]}
StacktraceCleaner.current_stacktraces
=> [
iex(1)> StacktraceCleaner.current_stacktrace
{StacktraceCleaner, :current_stacktraces, 1, [file: 'lib/stacktrace_cleaner.ex', line: 26]}
iex(2)> StacktraceCleaner.current_stacktraces
[
{StacktraceCleaner, :current_stacktraces, 1,
[file: 'lib/stacktrace_cleaner.ex', line: 26]},
{StacktraceCleanerTest, :"test current_stacktraces", 1,
[file: 'test/stacktrace_cleaner_test.exs', line: 16]}
]
StacktraceCleaner.clean(stacktraces)
=> [
iex(3)> StacktraceCleaner.clean(stacktraces)
[
{StacktraceCleanerTest, :"test clean", 1,
[file: 'test/stacktrace_cleaner_test.exs', line: 30]}
]
iex(4)> try do
...(4)> raise "Oh no!"
...(4)> rescue
...(4)> e in RuntimeError -> __STACKTRACE__ |> StacktraceCleaner.clean |> IO.inspect
...(4)> end
[
{StacktraceCleanerTest, :"test ", 1,
[
file: 'test/stacktrace_cleaner_test.exs',
line: 42,
error_info: %{module: Exception}
]}
]
```
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule StacktraceCleaner.MixProject do
use Mix.Project
@versoin "0.1.0"
@versoin "0.1.1"
@source_url "https://github.com/tashirosota/stacktrace_cleaner"
@description "Reduces and eliminates stacktraces noise, can get clean stack traces."
def project do
Expand Down

0 comments on commit 0bd9b63

Please sign in to comment.