Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

binaryseed
Copy link
Collaborator

@binaryseed binaryseed commented Dec 16, 2024

Address some warnings that arise across different Elixir versions

  • +0.0
  • Logger.warn

Also modify ConditionalCompile to not need a macro

@binaryseed binaryseed requested a review from tpitale December 16, 2024 03:58
@@ -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
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

@binaryseed
Copy link
Collaborator Author

This one is ready for review

@binaryseed binaryseed mentioned this pull request Dec 17, 2024
10 tasks
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.

2 participants