pan3793 commented on code in PR #51775:
URL: https://github.com/apache/spark/pull/51775#discussion_r2250856235


##########
common/utils/src/main/java/org/apache/spark/internal/SparkLogger.java:
##########
@@ -65,8 +66,10 @@
  * you can define `custom LogKey` and use it in `java` code as follows:
  * <p>
  *
- * // To add a `custom LogKey`, implement `LogKey`
- * public static class CUSTOM_LOG_KEY implements LogKey { }

Review Comment:
   if we override the `name()`, then both 4.0 and this PR work.
   
   ```
   public class JavaCustomLogKeys {
     // Custom `LogKey` must be `implements LogKey`
     public static class CUSTOM_LOG_KEY implements LogKey {
       @Override
       public String name() {
         return "custom_log_key";
       }
     }
   
     // Singleton
     public static final CUSTOM_LOG_KEY CUSTOM_LOG_KEY = new CUSTOM_LOG_KEY();
   }
   ```



-- 
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: reviews-unsubscr...@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to