hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1091289 - in /hive/trunk: cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
Date Tue, 12 Apr 2011 04:50:14 GMT
Author: namit
Date: Tue Apr 12 04:50:14 2011
New Revision: 1091289

URL: http://svn.apache.org/viewvc?rev=1091289&view=rev
Log:
HIVE-2107 Log4J initialization info should not be printed out if -S is
specified (Ning Zhang via namit)


Modified:
    hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java

Modified: hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java?rev=1091289&r1=1091288&r2=1091289&view=diff
==============================================================================
--- hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (original)
+++ hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java Tue Apr 12 04:50:14
2011
@@ -441,6 +441,7 @@ public class CliDriver {
     if (!oproc.process_stage2(ss)) {
       System.exit(2);
     }
+    ss.printInitInfo();
 
     // set all properties specified via command line
     HiveConf conf = ss.getConf();

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java?rev=1091289&r1=1091288&r2=1091289&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java Tue Apr 12
04:50:14 2011
@@ -284,12 +284,20 @@ public class SessionState {
   public static void initHiveLog4j() {
     // allow hive log4j to override any normal initialized one
     URL hive_l4j = SessionState.class.getClassLoader().getResource(HIVE_L4J);
-    if (hive_l4j == null) {
-      System.out.println("Unable to initialize logging. " + HIVE_L4J + " not found on CLASSPATH!");
-    } else {
+    if (hive_l4j != null) {
       LogManager.resetConfiguration();
       PropertyConfigurator.configure(hive_l4j);
-      SessionState.getConsole().printInfo("Logging initialized using configuration in " +
hive_l4j);
+    }
+  }
+
+  public void printInitInfo() {
+    URL hive_l4j = SessionState.class.getClassLoader().getResource(HIVE_L4J);
+    if (!isSilent) {
+      if (hive_l4j == null) {
+        System.err.println("Unable to initialize logging. " + HIVE_L4J + " not found on CLASSPATH!");
+      } else {
+        SessionState.getConsole().printInfo("Logging initialized using configuration in "
+ hive_l4j);
+      }
     }
   }
 



Mime
View raw message