hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [07/26] hbase git commit: HBASE-10092 Addendum. Move to slf4j. Few changes in bin/ scripts.
Date Fri, 22 Dec 2017 13:45:05 GMT
HBASE-10092 Addendum. Move to slf4j. Few changes in bin/ scripts.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5f02bf5b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5f02bf5b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5f02bf5b

Branch: refs/heads/HBASE-19397
Commit: 5f02bf5b7b471e093a546ea494b39216570105e7
Parents: a4272a9
Author: Apekshit Sharma <appy@apache.org>
Authored: Thu Dec 21 19:20:29 2017 -0800
Committer: Apekshit Sharma <appy@apache.org>
Committed: Thu Dec 21 19:22:00 2017 -0800

----------------------------------------------------------------------
 bin/draining_servers.rb             | 22 ++--------------------
 bin/replication/copy_tables_desc.rb |  4 ++--
 2 files changed, 4 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5f02bf5b/bin/draining_servers.rb
----------------------------------------------------------------------
diff --git a/bin/draining_servers.rb b/bin/draining_servers.rb
index 588bac4..27cc0fa 100644
--- a/bin/draining_servers.rb
+++ b/bin/draining_servers.rb
@@ -27,8 +27,7 @@ java_import org.apache.hadoop.hbase.HBaseConfiguration
 java_import org.apache.hadoop.hbase.client.ConnectionFactory
 java_import org.apache.hadoop.hbase.client.HBaseAdmin
 java_import org.apache.hadoop.hbase.zookeeper.ZKUtil
-java_import org.apache.commons.logging.Log
-java_import org.apache.commons.logging.LogFactory
+java_import org.slf4j.LoggerFactory
 
 # Name of this script
 NAME = 'draining_servers'.freeze
@@ -43,10 +42,6 @@ optparse = OptionParser.new do |opts|
     puts opts
     exit
   end
-  options[:debug] = false
-  opts.on('-d', '--debug', 'Display extra debug logging') do
-    options[:debug] = true
-  end
 end
 optparse.parse!
 
@@ -133,21 +128,8 @@ end
 
 hostOrServers = ARGV[1..ARGV.size]
 
-# Create a logger and disable the DEBUG-level annoying client logging
-def configureLogging(options)
-  apacheLogger = LogFactory.getLog(NAME)
-  # Configure log4j to not spew so much
-  unless options[:debug]
-    logger = org.apache.log4j.Logger.getLogger('org.apache.hadoop.hbase')
-    logger.setLevel(org.apache.log4j.Level::WARN)
-    logger = org.apache.log4j.Logger.getLogger('org.apache.zookeeper')
-    logger.setLevel(org.apache.log4j.Level::WARN)
-  end
-  apacheLogger
-end
-
 # Create a logger and save it to ruby global
-$LOG = configureLogging(options)
+$LOG = LoggerFactory.getLogger(NAME)
 case ARGV[0]
 when 'add'
   if ARGV.length < 2

http://git-wip-us.apache.org/repos/asf/hbase/blob/5f02bf5b/bin/replication/copy_tables_desc.rb
----------------------------------------------------------------------
diff --git a/bin/replication/copy_tables_desc.rb b/bin/replication/copy_tables_desc.rb
index c494765..44a24f9 100644
--- a/bin/replication/copy_tables_desc.rb
+++ b/bin/replication/copy_tables_desc.rb
@@ -24,7 +24,6 @@
 #
 
 include Java
-java_import org.apache.commons.logging.LogFactory
 java_import org.apache.hadoop.conf.Configuration
 java_import org.apache.hadoop.hbase.HBaseConfiguration
 java_import org.apache.hadoop.hbase.HConstants
@@ -32,6 +31,7 @@ java_import org.apache.hadoop.hbase.HTableDescriptor
 java_import org.apache.hadoop.hbase.TableName
 java_import org.apache.hadoop.hbase.client.ConnectionFactory
 java_import org.apache.hadoop.hbase.client.HBaseAdmin
+java_import org.slf4j.LoggerFactory
 
 # Name of this script
 NAME = 'copy_tables_desc'.freeze
@@ -64,7 +64,7 @@ end
 
 usage if ARGV.size < 2 || ARGV.size > 3
 
-LOG = LogFactory.getLog(NAME)
+LOG = LoggerFactory.getLogger(NAME)
 
 parts1 = ARGV[0].split(':')
 


Mime
View raw message