aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/spec
diff options
context:
space:
mode:
authorGravatar Tim Emiola <temiola@google.com>2015-08-17 12:22:23 -0700
committerGravatar Tim Emiola <temiola@google.com>2015-08-17 12:27:08 -0700
commit25f501132b83c91281ffeaa08b49e458ab812952 (patch)
tree0dc1d2a7ebd33ed8945a2fac51f4bcd7438e1fb5 /src/ruby/spec
parentb7eefcf757f2e62b82a812373a25a772824ef7c6 (diff)
Remove the runtime dependency on the logging gem.
- provides a noop logger unless the user explicit adds a logging method to the GRPC namespace
Diffstat (limited to 'src/ruby/spec')
-rw-r--r--src/ruby/spec/spec_helper.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ruby/spec/spec_helper.rb b/src/ruby/spec/spec_helper.rb
index 270d2e97d3..c891c1bf5e 100644
--- a/src/ruby/spec/spec_helper.rb
+++ b/src/ruby/spec/spec_helper.rb
@@ -47,11 +47,23 @@ require 'rspec'
require 'logging'
require 'rspec/logging_helper'
+# GRPC is the general RPC module
+#
+# Configure its logging for fine-grained log control during test runs
+module GRPC
+ extend Logging.globally
+end
+Logging.logger.root.appenders = Logging.appenders.stdout
+Logging.logger.root.level = :info
+Logging.logger['GRPC'].level = :info
+Logging.logger['GRPC::ActiveCall'].level = :info
+Logging.logger['GRPC::BidiCall'].level = :info
+
# Configure RSpec to capture log messages for each test. The output from the
# logs will be stored in the @log_output variable. It is a StringIO instance.
RSpec.configure do |config|
include RSpec::LoggingHelper
- config.capture_log_messages
+ config.capture_log_messages # comment this out to see logs during test runs
end
RSpec::Expectations.configuration.warn_about_potential_false_positives = false