MM-41143: Pass a custom logger to morph (#19530)
We create a custom io.Writer to pass to the logger instance. For now, we keep everything to debug as all errors are surfaced back to the server via the API. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3f52bd197a
Коммит
01a3ed0d3e
@@ -147,3 +147,14 @@ func constructArrayArgs(ids []string) (string, []interface{}) {
|
||||
|
||||
return "(" + placeholder.String() + ")", values
|
||||
}
|
||||
|
||||
// morphWriter is a target to pass to the logger instance of morph.
|
||||
// For now, everything is just logged at a debug level. If we need to log
|
||||
// errors/warnings from the library also, that needs to be seen later.
|
||||
type morphWriter struct {
|
||||
}
|
||||
|
||||
func (l *morphWriter) Write(in []byte) (int, error) {
|
||||
mlog.Debug(string(in))
|
||||
return len(in), nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user