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 tag support to sdkLogger #2512

Merged
merged 2 commits into from Feb 16, 2022

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Feb 16, 2022

What changed?
Add tag support to sdkLogger.
Also accidentally updated submodules.

Why?
To improve logging experience from internal workflows. Now it is possible to use internal tag.Tag with workflow logger.

How did you test it?
Added new unit tests.

Potential risks
No risks.

Is hotfix candidate?
No.

@alexshtin alexshtin requested a review from a team as a code owner February 16, 2022 02:23
@alexshtin alexshtin force-pushed the feature/sdk-logger-tag-support branch 2 times, most recently from ef200cf to 833fd5c Compare February 16, 2022 02:29
@alexshtin alexshtin force-pushed the feature/sdk-logger-tag-support branch from 833fd5c to 4629842 Compare February 16, 2022 02:36
tags = append(tags, tag.NewAnyTag(key, keyvals[i+1]))
var val interface{}
if i+1 == len(keyvals) {
val = fmt.Sprintf("last key %q doesn't have value", key)
Copy link
Member

Choose a reason for hiding this comment

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

Just use a const string as value is enough, for example no value. The key is on the tag anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

It should never happen, but I like the idea, in case if you want to log just a key.

@alexshtin alexshtin enabled auto-merge (squash) February 16, 2022 03:12
@alexshtin alexshtin merged commit b0f9d3a into temporalio:master Feb 16, 2022
@alexshtin alexshtin deleted the feature/sdk-logger-tag-support branch February 16, 2022 06:53
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