wangyang0918 commented on code in PR #160:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/160#discussion_r845685451


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/EnvUtils.java:
##########
@@ -68,4 +90,102 @@ public static String getRequired(String key) {
         }
         return value;
     }
+
+    /**
+     * Logs information about the environment, like code revision, current 
user, Java version, and
+     * JVM parameters.
+     *
+     * @param log The logger to log the information to.
+     * @param componentName The component name to mention in the log.
+     * @param commandLineArgs The arguments accompanying the starting the 
component.
+     */
+    public static void logEnvironmentInfo(
+            Logger log, String componentName, String[] commandLineArgs) {
+        if (log.isInfoEnabled()) {
+            EnvironmentInformation.RevisionInformation rev = 
getRevisionInformation();
+            String javaHome = System.getenv("JAVA_HOME");
+            String inheritedLogs = System.getenv("FLINK_INHERITED_LOGS");
+            String arch = System.getProperty("os.arch");
+            long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;
+            if (inheritedLogs != null) {
+                log.info(
+                        
"--------------------------------------------------------------------------------");
+                log.info(" Preconfiguration: ");
+                log.info(inheritedLogs);
+            }
+            log.info(
+                    
"--------------------------------------------------------------------------------");
+            log.info(
+                    " Starting "
+                            + componentName
+                            + " (Version: "
+                            + getProjectVersion()
+                            + ", Flink Version: "
+                            + getVersion()
+                            + ", Scala: "
+                            + getScalaVersion()
+                            + ", "
+                            + "Rev:"
+                            + rev.commitId
+                            + ", "
+                            + "Date:"
+                            + rev.commitDate
+                            + ")");
+            log.info(" OS current user: " + System.getProperty("user.name"));
+            log.info(" Current Hadoop/Kerberos user: " + getHadoopUser());
+            log.info(" JVM: " + getJvmVersion());
+            log.info(" Arch: " + arch);
+            log.info(" Maximum heap size: " + maxHeapMegabytes + " MiBytes");
+            log.info(" JAVA_HOME: " + (javaHome == null ? "(not set)" : 
javaHome));
+            String hadoopVersionString = getHadoopVersionString();

Review Comment:
   We do not need the hadoop related information.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to