-
Notifications
You must be signed in to change notification settings - Fork 98
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
Conditional compilation to address warnings #456
base: master
Are you sure you want to change the base?
Conversation
lib/new_relic/logger.ex
Outdated
@@ -81,7 +81,13 @@ defmodule NewRelic.Logger do | |||
|
|||
defp elixir_logger(:debug, message), do: Logger.debug(message) | |||
defp elixir_logger(:info, message), do: Logger.info(message) | |||
defp elixir_logger(:warn, message), do: Logger.warn(message) | |||
|
|||
if Version.match?(System.version(), ">= 1.11.0") do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have that ConditionalCompile
, should this also use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: do we support elixir before 1.11? The earliest we test against is 1.11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks missed this spot. Updated all of them to use ConditionalCompile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what we "support"
#454 changes the test matrix to the last 4 versions, and Elixir itself seems to support the last 5 versions with security patches.
https://hexdocs.pm/elixir/1.18.0-rc.0/compatibility-and-deprecations.html
We could adopt that, which would put us at 1.14
and above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless, 1.10 and 1.11 are very old, so I've removed the conditionals that matched those version
This one is ready for review |
Address some warnings that arise across different Elixir versions
+0.0
Logger.warn
Also modify
ConditionalCompile
to not need a macro