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

Add caller expression argument attribute to auto label dumps #16

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

SaahilClaypool
Copy link
Contributor

@SaahilClaypool SaahilClaypool commented Aug 9, 2023

Hi - great library! I've been using this and I thought it'd be useful to use the caller argument expression attribute to set the label to the variable name that is being dumped when not otherwise provided.

Just thought it'd be useful

@MoaidHathot
Copy link
Owner

Thanks!
this means we'll always have a Label to our objects. I'll merge this PR and play with it a bit. Maybe I'll add a configuration to turn it o or off later.

@MoaidHathot MoaidHathot merged commit c3a2cd1 into MoaidHathot:main Aug 10, 2023
1 check passed
@MoaidHathot
Copy link
Owner

Thanks @SaahilClaypool

@MoaidHathot
Copy link
Owner

Hi @SaahilClaypool , this change is part of the new release, but notice that I made a few changes. This feature won't be on by default, at least until we hear some feedback from the community.
You can turn this feature on or off via per-dump or globaly (for all dumps) config

    new { Description = "You can manually specify labels to objects" }.Dump("Manual label");

    //Set auto-label globally for all dumps if a custom label wasn't provider
    DumpConfig.Default.UseAutoLabels = true;
    new { Description = "Or set labels automatically with auto-labels" }.Dump();

image

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

3 participants