diff options
-rw-r--r-- | lib/chef/log.rb | 2 | ||||
-rw-r--r-- | spec/unit/log_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/log.rb b/lib/chef/log.rb index 0835a9f2c5..2dd2896fd9 100644 --- a/lib/chef/log.rb +++ b/lib/chef/log.rb @@ -41,7 +41,7 @@ class Chef def write(message) data = message.match(/(\[.+?\]) ([\w]+):(.*)$/) - self.send(data[2].downcase.to_sym, data[3]) + self.send(data[2].downcase.to_sym, data[3].strip) rescue NoMethodError self.send(:info, message) end diff --git a/spec/unit/log_spec.rb b/spec/unit/log_spec.rb index 756e5b43e0..931d0adf11 100644 --- a/spec/unit/log_spec.rb +++ b/spec/unit/log_spec.rb @@ -27,12 +27,12 @@ describe Chef::Log::Syslog do let(:logger) { Chef::Log::Syslog.new } it "should send message with severity info to syslog." do - expect_any_instance_of(Logger::Syslog).to receive(:info).with(" *** Chef 12.4.0.dev.0 ***") + expect_any_instance_of(Logger::Syslog).to receive(:info).with("*** Chef 12.4.0.dev.0 ***") logger.write("[2015-04-23T15:16:23+09:00] INFO: *** Chef 12.4.0.dev.0 ***") end it "should send message with severity warning to syslog." do - expect_any_instance_of(Logger::Syslog).to receive(:warn).with(" No config file found or specified on command line, using command line options.") + expect_any_instance_of(Logger::Syslog).to receive(:warn).with("No config file found or specified on command line, using command line options.") logger.write("[2015-04-23T15:16:20+09:00] WARN: No config file found or specified on command line, using command line options.") end |