You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/07/25 10:32:47 UTC

[GitHub] [incubator-kyuubi] ulysses-you commented on a diff in pull request #3132: [KYUUBI #3131] use `\n` to replace `,` in operation state change logging

ulysses-you commented on code in PR #3132:
URL: https://github.com/apache/incubator-kyuubi/pull/3132#discussion_r928719575


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala:
##########
@@ -103,16 +103,18 @@ abstract class AbstractOperation(session: Session) extends Operation with Loggin
 
   protected def setState(newState: OperationState): Unit = {
     OperationState.validateTransition(state, newState)
-    var timeCost = ""
     newState match {
-      case RUNNING => startTime = System.currentTimeMillis()
+      case RUNNING =>
+        info(s"Processing ${session.user}'s query[$statementId]: " +
+          s"${state.name} -> ${newState.name}, statement:\n$redactedStatement")
+        startTime = System.currentTimeMillis()
       case ERROR | FINISHED | CANCELED | TIMEOUT =>
         completedTime = System.currentTimeMillis()
-        timeCost = s", time taken: ${(completedTime - startTime) / 1000.0} seconds"
+        val timeCost = s"\ntime taken: ${(completedTime - startTime) / 1000.0} seconds"
+        info(s"Processing ${session.user}'s query[$statementId]: " +
+          s"${state.name} -> ${newState.name}$timeCost")

Review Comment:
   for terminated state, simplify to log user, statementId and timeCost



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org