Skip to content

Conversation

@chsukivra
Copy link
Contributor

@chsukivra chsukivra commented Oct 5, 2021

meta_without

A way to opt-out of fields from the meta object. A list of field names (often atoms). Default excludes report_cb

meta_with

A way to opt-in of fields from the meta object. A list of field names (often atoms). Default is all fields remaining after opt-out.

@chsukivra chsukivra force-pushed the feat-selective-meta branch from 7675414 to 356476a Compare October 6, 2021 07:54
@chsukivra chsukivra requested a review from a team October 6, 2021 07:54
Copy link

@rolkar-kivra rolkar-kivra left a comment

Choose a reason for hiding this comment

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

I think this looks nice.

You may consider my comments or not.

To control what is being included in the log object from the metadata, there
are two ways. One can opt-out from fields. Default opts out is `[report_cb]`.

#{ meta_without => [report_cb, gl, file, domain] }

Choose a reason for hiding this comment

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

I think we need wild cards here.

At least "meta_without => all" or "meta_without => ['*'].

are two ways. One can opt-out from fields. Default opts out is `[report_cb]`.

#{ meta_without => [report_cb, gl, file, domain] }

Choose a reason for hiding this comment

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

How about nested keys? Like #{extras => #{foo => <<"smörgås">>}}.

meta_without = [{extras,foo}]

Or for very detailed control there is instead opt-in.

#{ meta_with => [time, mfa, line, user_key, client_key] }

Choose a reason for hiding this comment

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

Then you could do

meta_without = [extras]
meta_with = [{extras,foo}]

to only include foo from extras.

Choose a reason for hiding this comment

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

One question

Do we need msg_without and msg_with ?

Or is that something that the application needs to handle itself?

@rolkar-kivra
Copy link

rolkar-kivra commented Oct 6, 2021

One more comment. Maybe

without = [{meta,extras}]
with = [{meta,extras,foo}]

It is more flexible

@chsukivra chsukivra merged commit c7c7a75 into master Oct 6, 2021
@chsukivra chsukivra deleted the feat-selective-meta branch October 6, 2021 11:13
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.

4 participants