Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set the default log level to WARN #73

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ddtrace/tracer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class Tracer
def self.log
unless defined? @logger
@logger = Logger.new(STDOUT)
@logger.level = Logger::INFO
@logger.level = Logger::WARN
end
@logger
end

# Activate the debug mode providing more information related to tracer usage
def self.debug_logging=(value)
log.level = value ? Logger::DEBUG : Logger::INFO
log.level = value ? Logger::DEBUG : Logger::WARN
end

# Return if the debug mode is activated or not
Expand Down
5 changes: 2 additions & 3 deletions test/logger_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ def test_tracer_logger
end

def test_tracer_default_debug_mode
# the default log level must be INFO
logger = Datadog::Tracer.log
assert_equal(logger.level, Logger::INFO)
assert_equal(logger.level, Logger::WARN)
end

def test_tracer_set_debug_mode
Expand All @@ -24,6 +23,6 @@ def test_tracer_set_debug_mode

# revert to production mode
Datadog::Tracer.debug_logging = false
assert_equal(logger.level, Logger::INFO)
assert_equal(logger.level, Logger::WARN)
end
end