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 helper method to name parameter like $”{(keyName, value)} #92

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

hadashiA
Copy link
Contributor

@hadashiA hadashiA commented Oct 20, 2023

Add ZLogger.Param(keyName, value) helper.
Let's give ValueTuple<string, T> special treatment.

It is for specifying the name of the parameter key for each ZLog call individually.

How to:

var id = 111;
logger.ZLogInformation($"......... {("userId",  id)} ........");

// plain text result
// #=> "......... 111 ........"

// json result
// #=> { "userId": 111, "Message": "......... 111 ........", ... }

@neuecc
Copy link
Member

neuecc commented Oct 20, 2023

same name of namespace and class name is......

@hadashiA hadashiA force-pushed the hadashiA/named-param branch from 0b1d7c2 to b8de8d1 Compare October 20, 2023 11:30
@hadashiA
Copy link
Contributor Author

After discussion this, I remove ZLogger.Param, and fix up instead of used (string, T)...!

@hadashiA hadashiA changed the title Add helper method to name parameter like $”{ZLogger.Param(…)} Add helper method to name parameter like $”{(keyName, value)} Oct 20, 2023
@hadashiA hadashiA force-pushed the hadashiA/named-param branch from b8de8d1 to b4a06d5 Compare October 26, 2023 00:43
@hadashiA hadashiA force-pushed the hadashiA/named-param branch from b4a06d5 to 1ff161e Compare November 9, 2023 08:46
@neuecc neuecc merged commit 33f14fc into v2.0 Nov 9, 2023
1 check failed
@neuecc neuecc deleted the hadashiA/named-param branch November 9, 2023 08:48
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.

2 participants