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

Collect vargs parameter #35

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

Conversation

Michieljoris
Copy link

@Michieljoris Michieljoris commented Nov 24, 2023

This PR fixes hardcoding of msg-key and level-key in the install fn and allows the use of a custom collect-vargs fn so that for instance only last arg (if a map) to a log fn will be added as args to the json map.

?msg-fmt (let [format-specifiers (count-format-specifiers ?msg-fmt)
[message vargs] (split-at format-specifiers vargs)
message (String/format ?msg-fmt (to-array message))
args (if (and (= 1 (count vargs))
Copy link
Author

Choose a reason for hiding this comment

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

This bypasses logic in collect-vargs

key-names default-key-names}}]
key-names default-key-names
msg-key (:msg key-names)
level-key (:level key-names)
Copy link
Author

Choose a reason for hiding this comment

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

Get defaults for msg-key and level-key from key-names which falls back to default-key-names

@Michieljoris Michieljoris force-pushed the collect-vargs-parameter branch from b7ad608 to 4e280db Compare November 24, 2023 04:43
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.

1 participant