srowen commented on a change in pull request #24684: [SPARK-27657][ML]Fix the 
log format of ml.util.Instrumentation.logFai…
URL: https://github.com/apache/spark/pull/24684#discussion_r287609978
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala
 ##########
 @@ -161,8 +162,9 @@ private[spark] class Instrumentation private () extends 
Logging with MLEvents {
    * Logs an exception raised during a training session.
    */
   def logFailure(e: Throwable): Unit = {
-    val msg = e.getStackTrace.mkString("\n")
-    super.logError(msg)
+    val msg = new StringWriter()
+    e.printStackTrace(new PrintWriter(msg))
+    super.logError(msg.toString)
 
 Review comment:
   I'm not clear what the change is... is it indentation? then I agree. Where 
else do we have the same issue?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to