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

Include file, line and mfa in basic formatter metadata #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ppeerttu
Copy link

@ppeerttu ppeerttu commented Oct 14, 2024

Include file, line and mfa in the basic formatter metadata.

Fixes #137

@ppeerttu ppeerttu marked this pull request as ready for review October 14, 2024 07:28
@ppeerttu ppeerttu force-pushed the fix/include-file-line-mfa-in-basic-formatter-metadata branch from 2365e64 to 9a2decf Compare October 14, 2024 07:40
assert metadata |> Map.get("file") |> to_string() =~ "logger_json/formatters/basic_test.exs"
assert metadata |> Map.get("line") |> is_integer()

assert metadata["mfa"] === [
Copy link
Member

@AndrewDryga AndrewDryga Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it more readable I think we need a special case for encoding this one, making it look like an anonymous function, e.g.: Elixir.LoggerJSON.Formatters.BasicTest."test logs file, line and mfa as metadata"/1. See here: https://github.com/Nebo15/logger_json/blob/master/lib/logger_json/formatters/google_cloud.ex#L237

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, good point. How about now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndrewDryga pinging just in case forgotten - please have a look whenever you have time! 🙏

@ppeerttu ppeerttu force-pushed the fix/include-file-line-mfa-in-basic-formatter-metadata branch from 9a2decf to edbcad7 Compare October 16, 2024 12:27
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.

Basic formatter discarding file, line and mfa
2 participants