spandex-project / spandex

A platform agnostic tracing library
MIT License
333 stars 53 forks source link

Replace System.stacktrace with __STACKTRACE__ #119

Closed mbuhot closed 3 years ago

mbuhot commented 3 years ago

Elixir 1.11 generates deprecation warnings from the use of System.stacktrace/0 in the trace macro.

Eg:

warning: System.stacktrace/0 is deprecated, use __STACKTRACE__ instead
  lib/services/search/elasticsearch.ex:195

Since the warning is reported as being in my application code (rather than the library), the build fails when compiling with the --warnings-as-errors flag.

This PR changes the implementation to use __STACKTRACE__ instead, which should be equivalent. I've also updated the minimum elixir version to 1.7, since __STACKTRACE__ isn't supported in lower versions.