This is an automated email from the ASF dual-hosted git repository.

pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git


The following commit(s) were added to refs/heads/main by this push:
     new 3e6e1e62 replace scala string interpolation in logging (#715)
3e6e1e62 is described below

commit 3e6e1e6225058592b3b8f4fb5e2e04b26add8de8
Author: PJ Fanning <[email protected]>
AuthorDate: Mon Jun 1 11:27:45 2026 +0100

    replace scala string interpolation in logging (#715)
    
    * Changes before error encountered
    
    Agent-Logs-Url: 
https://github.com/pjfanning/incubator-pekko-grpc/sessions/9005fd88-3d59-4bfb-9fb9-a4c6e6f5456f
    
    * Add level-enabled guards for non-trivial logging in AbstractGenerateMojo
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] 
<[email protected]>
---
 .../org/apache/pekko/grpc/maven/AbstractGenerateMojo.scala   | 12 ++++++++----
 .../scala/org/apache/pekko/grpc/internal/ChannelUtils.scala  |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/maven-plugin/src/main/scala/org/apache/pekko/grpc/maven/AbstractGenerateMojo.scala
 
b/maven-plugin/src/main/scala/org/apache/pekko/grpc/maven/AbstractGenerateMojo.scala
index 8f3cb45c..5f8bedb7 100644
--- 
a/maven-plugin/src/main/scala/org/apache/pekko/grpc/maven/AbstractGenerateMojo.scala
+++ 
b/maven-plugin/src/main/scala/org/apache/pekko/grpc/maven/AbstractGenerateMojo.scala
@@ -253,11 +253,15 @@ abstract class AbstractGenerateMojo @Inject() 
(buildContext: BuildContext) exten
       .sortBy(_.outputPath.getAbsolutePath.length)
     generatedTargets.foreach(_.outputPath.mkdirs())
     if (schemas.nonEmpty && generatedTargets.nonEmpty) {
-      getLog.info(
-        "Compiling %d protobuf files to %s".format(schemas.size, 
generatedTargets.map(_.outputPath).mkString(",")))
+      if (getLog.isInfoEnabled) {
+        getLog.info(
+          "Compiling %d protobuf files to %s".format(schemas.size, 
generatedTargets.map(_.outputPath).mkString(",")))
+      }
       schemas.foreach { schema => buildContext.removeMessages(schema) }
-      getLog.debug("Compiling schemas [%s]".format(schemas.mkString(",")))
-      getLog.debug("protoc options: %s".format(protocOptions.mkString(",")))
+      if (getLog.isDebugEnabled) {
+        getLog.debug("Compiling schemas [%s]".format(schemas.mkString(",")))
+        getLog.debug("protoc options: %s".format(protocOptions.mkString(",")))
+      }
 
       getLog.info("Compiling protobuf")
       val (out, err, exitCode) = captureStdOutAndErr {
diff --git 
a/runtime/src/main/scala/org/apache/pekko/grpc/internal/ChannelUtils.scala 
b/runtime/src/main/scala/org/apache/pekko/grpc/internal/ChannelUtils.scala
index f823e9a1..9298cbcc 100644
--- a/runtime/src/main/scala/org/apache/pekko/grpc/internal/ChannelUtils.scala
+++ b/runtime/src/main/scala/org/apache/pekko/grpc/internal/ChannelUtils.scala
@@ -75,7 +75,7 @@ object ChannelUtils {
       maxConnectionAttempts: Option[Int],
       log: LoggingAdapter): Unit = {
     def monitor(currentState: ConnectivityState, connectionAttempts: Int): 
Unit = {
-      log.debug(s"monitoring with state $currentState and connectionAttempts 
$connectionAttempts")
+      log.debug("monitoring with state {} and connectionAttempts {}", 
currentState, connectionAttempts)
       val newAttemptOpt = currentState match {
         case ConnectivityState.TRANSIENT_FAILURE =>
           if (maxConnectionAttempts.contains(connectionAttempts + 1)) {


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

Reply via email to