8000 Blame exceptions by axelson · Pull Request #1 · axelson/ring_logger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Blame exceptions #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

Blame exceptions #1

wants to merge 46 commits into from

Conversation

axelson
Copy link
Owner
@axelson axelson commented Sep 25, 2021

This makes for much nicer error messages, but at the cost of performance.

Old:

09:26:20.545 [error] GenServer RingLoggerUser.Worker terminating
** (FunctionClauseError) no function clause matching in RingLoggerUser.Worker.crash/1
(ring_logger_user 0.1.0) lib/ring_logger_user/worker.ex:20: RingLoggerUser.Worker.crash(nil)
(stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
(stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6
(stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: :tick
State: []

New:

09:27:17.469 [error] ** (FunctionClauseError) no function clause matching in RingLoggerUser.Worker.crash/1

The following arguments were given to RingLoggerUser.Worker.crash/1:

# 1
nil

Attempted function clauses (showing 2 out of 2):

def crash(-:crash-)
def crash(-:work-)

(ring_logger_user 0.1.0) lib/ring_logger_user/worker.ex:20: RingLoggerUser.Worker.crash(nil)
(stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
(stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6
(stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

dependabot bot and others added 30 commits October 21, 2021 09:19
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.25.2 to 0.25.5.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/master/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.25.2...v0.25.5)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Currently when `Logger.configure_backend` is called the configuration is
stored under `:logger, RingLogger` but the initial configuration was
still being read from `:ring_logger`

Also the `colors` configuration in the documentation had a typo
But log a warning when it happens
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.26.0 to 0.27.3.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/v0.27.3/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.26.0...v0.27.3)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.27.3 to 0.28.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.27.3...v0.28.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.1 to 0.28.2.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.28.1...v0.28.2)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [circular_buffer](https://github.com/keathley/circular_buffer) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/keathley/circular_buffer/releases)
- [Commits](elixir-toniq/circular_buffer@v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: circular_buffer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
The default for outputting color is determined by `IO.ANSI.enabled?`, but it
is applied in the `%RingLogger.Client.State{}` struct which is evaluated at
compile time so it will always be `false` and remove the color output.

This change forces in a `:colors` option key when building defaults if it
was not already present (which is normally the case). This will then cause
the config check to go through the configuring colors option which evaluates
`IO.ANSI.enabled?` at runtime for more accurate settings for the prints.
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.2 to 0.28.3.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/commits)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.3 to 0.28.4.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.28.3...v0.28.4)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
`:before` and `:after` options can be used with grep to include more
lines before/after the match. Helpful for cases where you might want to
see a little more data in series but don't know exact search terms.

Mimics `-A` and `-B` options of `grep`
* remove deprecated `:race_conditions` dialyzer option
* Add new `:missing_return` and `:extra_return` dialyzer options
* Update Elixir/Erlang CI versions
Bumps [dialyxir](https://github.com/jeremyjh/dialyxir) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/jeremyjh/dialyxir/releases)
- [Changelog](https://github.com/jeremyjh/dialyxir/blob/master/CHANGELOG.md)
- [Commits](jeremyjh/dialyxir@1.1.0...1.2.0)

---
updated-dependencies:
- dependency-name: dialyxir
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.4 to 0.28.5.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/v0.28.5/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.28.4...v0.28.5)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Elixir 1.4 removed support for `$levelpad` and dropped it from the
default formatter pattern. This updates the unit tests to force a format
pattern rather than relying on the default one.
This didn't affect the results of any tests since the inputs are limited
to ASCII characters.
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.5 to 0.28.6.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.28.5...v0.28.6)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
dependabot bot and others added 16 commits October 20, 2022 10:37
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.6 to 0.29.0.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.28.6...v0.29.0)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.0 to 0.29.1.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](elixir-lang/ex_doc@v0.29.0...v0.29.1)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Previous versions still work, but from this point on, we won't support
issues with them. This also allows us to use functions that have been
added to the language since RingLogger was originally implemented.
Missing spec errors were disabled since that will take a longer pass.
If configured, allow for multiple buffers that are merged based on
monotonic time. This allows for lower level logs to not be wiped out by
verbose debug logging.
The specs identified several places that had unnecessary code so this
also cleans them up.

It also removes a workaround for Elixir 1.8 and earlier with the unit
tests.
There's an outstanding PR that breaks the API, and the new multiple
buffer feature influences how this would actually be used in NervesMOTD.
Results in much more detailed error messages

Old:
> 09:26:20.545 [error] GenServer RingLoggerUser.Worker terminating
> ** (FunctionClauseError) no function clause matching in RingLoggerUser.Worker.crash/1
>     (ring_logger_user 0.1.0) lib/ring_logger_user/worker.ex:20: RingLoggerUser.Worker.crash(nil)
>     (stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
>     (stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6
>     (stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
> Last message: :tick
> State: []

New:
> 09:27:17.469 [error] ** (FunctionClauseError) no function clause matching in RingLoggerUser.Worker.crash/1
>
> The following arguments were given to RingLoggerUser.Worker.crash/1:
>
>     # 1
>     nil
>
> Attempted function clauses (showing 2 out of 2):
>
>     def crash(-:crash-)
>     def crash(-:work-)
>
>     (ring_logger_user 0.1.0) lib/ring_logger_user/worker.ex:20: RingLoggerUser.Worker.crash(nil)
>     (stdlib 3.15) gen_server.erl:695: :gen_server.try_dispatch/4
>     (stdlib 3.15) gen_server.erl:771: :gen_server.handle_msg/6
>     (stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0