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
[SPARK-47688][CORE] Support three
methods of the log concatenation
in the structured logging framework
#45813
base: master
Are you sure you want to change the base?
Conversation
normal variables
and MDC
three
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 framework
three
methods of the log concatenation
in the structured logging framework
@@ -96,17 +109,21 @@ trait Logging { | |||
} | |||
|
|||
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. |
What changes were proposed in this pull request?
The pr aims to support
three
methods of the logconcatenation
in thestructured logging framework
. eg:Why are the changes needed?
Sometimes we just want to make some
simple variable replacements
in the log text, without the need for MDCAt present, the above logs,
compile
will 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.