-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-47688][CORE] Support three methods of the log concatenation in the structured logging framework
#45813
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
Conversation
normal variables and MDCthree types of the log concatenation in the structured logging framework
| object MDC { | ||
|
|
||
| implicit class StringImprovements(val s: String) { | ||
| def ++(mdc: MessageWithContext): MessageWithContext = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name cannot be called + and does not take effect, so it is called ++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Some of the comments were |
three types of the log concatenation in the structured logging frameworkthree methods of the log concatenation in the structured logging framework
|
|
||
| implicit class LogStringContext(val sc: StringContext) { | ||
| def log(args: MDC*): MessageWithContext = { | ||
| def log(args: Any*): MessageWithContext = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The args here is intended to MDC. So that we can enforce all the variables to be MDC.
In this case, we should convert |
|
@gengliangwang |
So by the end of this project, all the log entries containing variables will use |
Okay, regarding this issue, I will investigate it carefully again. |
|
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |

What changes were proposed in this pull request?
The pr aims to support
threemethods of the logconcatenationin thestructured logging framework. eg:Why are the changes needed?
Sometimes we just want to make some
simple variable replacementsin the log text, without the need for MDCAt present, the above logs,
compilewill fail.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Add new UT.
Was this patch authored or co-authored using generative AI tooling?
No.