Closed helsaawy closed 1 year ago
@thaJeztah @kevpar
This seems very application-specific to moby. Rather than add an already-deprecated function here, wouldn't it be easier for moby to just define their own function and use that while transitioning to structured logging?
func WriteEventString(p *etw.Provider, m string) error {
return p.WriteEvent("StringMessage", []etw.EventOpt{etw.WithLevel(0)}, []etw.FieldOpt{etw.StringField("message", m)})
}
@thaJeztah Would you be able to do something like below in moby as an interim until you fully transition?
type Provide struct {
*etw.Provider
}
func (p *etw.Provider) WriteEventString(m string) error {
return p.WriteEvent("StringMessage", []etw.EventOpt{etw.WithLevel(0)}, []etw.FieldOpt{etw.StringField("message", m)})
}
Thanks for the suggestions! Yes, if we can do it without changes here, that'd definitely be fine with me.
I'm at KubeCon this week, so limited time at my computer. Will try to get back to that soon (if not, please give me a "ping" ☺️😅
Okay, I'll close this then. In the meantime; enjoy kubecon :)
This is an implementation of #262.
Adds a
(*Provider).WriteEventString
to write a single string to ETW Since the intent is to add an intermediary function for Moby to call while they transition to this library, the function is marked as deprecated, to ward against future use.Signed-off-by: Hamza El-Saawy hamzaelsaawy@microsoft.com