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

handle non-object arguments #78

Merged
merged 3 commits into from
Nov 25, 2022

Conversation

schehata
Copy link
Collaborator

when arguments are spread like this ...args it automatically converts to an objects, and then we lose the value.
for example:

log.info('foo', 'bar') 

would result in args = {0: 'b', 1: 'a', 2: 'r'}

This PR, handles the arguments in the _log method and checks if its an object or not, if the passed args is not an object, it will be stored in fields.args as it is.

@vercel
Copy link

vercel bot commented Nov 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
next-axiom-example ✅ Ready (Inspect) Visit Preview Nov 25, 2022 at 11:35AM (UTC)

@schehata schehata requested a review from bahlo November 22, 2022 09:50
Copy link
Member

@bahlo bahlo left a comment

Choose a reason for hiding this comment

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

two qs

package.json Outdated Show resolved Hide resolved
src/logger.ts Outdated Show resolved Hide resolved
Copy link
Member

@bahlo bahlo left a comment

Choose a reason for hiding this comment

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

nice work 👏

@bahlo bahlo merged commit b6bb6d9 into main Nov 25, 2022
@bahlo bahlo deleted the islam/dx-363-check-if-you-can-pass-a-string-as-fields branch November 25, 2022 13:54
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.

None yet

2 participants