diff options
author | Thom May <thom@chef.io> | 2018-01-04 11:44:32 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2018-02-22 09:59:23 +0000 |
commit | b28a6106ea8b6b7625077341964c3257679fcf59 (patch) | |
tree | af1352af435dd1c7325531af580190cb0da5a39f /spec | |
parent | 17b91dd99492e6eb528bfa5049753287ac7fa2a5 (diff) | |
download | mixlib-log-b28a6106ea8b6b7625077341964c3257679fcf59.tar.gz |
add trace level
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/log_spec.rb | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb index ac4932d..137b557 100644 --- a/spec/mixlib/log_spec.rb +++ b/spec/mixlib/log_spec.rb @@ -38,7 +38,7 @@ class LoggerLike @messages << message end - [:debug, :info, :warn, :error, :fatal].each do |method_name| + [:trace, :debug, :info, :warn, :error, :fatal].each do |method_name| class_eval(<<-E) def #{method_name}(message) @messages << message @@ -95,13 +95,14 @@ RSpec.describe Mixlib::Log do expect(Logit.configured?).to be true end - it "should set the log level using the binding form, with :debug, :info, :warn, :error, or :fatal" do + it "should set the log level using the binding form, with :trace, :debug, :info, :warn, :error, or :fatal" do levels = { - :debug => Logger::DEBUG, - :info => Logger::INFO, - :warn => Logger::WARN, - :error => Logger::ERROR, - :fatal => Logger::FATAL, + :trace => Mixlib::Log::TRACE, + :debug => Mixlib::Log::DEBUG, + :info => Mixlib::Log::INFO, + :warn => Mixlib::Log::WARN, + :error => Mixlib::Log::ERROR, + :fatal => Mixlib::Log::FATAL, } levels.each do |symbol, constant| Logit.level = symbol @@ -117,13 +118,14 @@ RSpec.describe Mixlib::Log do expect(logdev.string).to match(/the_message/) end - it "should set the log level using the method form, with :debug, :info, :warn, :error, or :fatal" do + it "should set the log level using the method form, with :trace, :debug, :info, :warn, :error, or :fatal" do levels = { - :debug => Logger::DEBUG, - :info => Logger::INFO, - :warn => Logger::WARN, - :error => Logger::ERROR, - :fatal => Logger::FATAL, + :trace => Mixlib::Log::TRACE, + :debug => Mixlib::Log::DEBUG, + :info => Mixlib::Log::INFO, + :warn => Mixlib::Log::WARN, + :error => Mixlib::Log::ERROR, + :fatal => Mixlib::Log::FATAL, } levels.each do |symbol, constant| Logit.level(symbol) |