diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | lib/puppet/util/log.rb | 3 | ||||
-rwxr-xr-x | spec/unit/util/log.rb | 7 |
3 files changed, 10 insertions, 3 deletions
@@ -2,6 +2,9 @@ Fixing #947 - pluginsync no longer fails poorly when no plugins exist Fixed #981 - Removed 'Adding aliases' info message + + Fixing #1089 - Log messages are now tagged with the log level, + making it easier to match messages in the 'tagmail' report. Fixing #1614 - Environments no longer have to be listed out diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index f5119bbff..35249495d 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -509,6 +509,9 @@ class Puppet::Util::Log @source = "Puppet" end + # Tag myself with my log level + tag(level) + Log.newmessage(self) end diff --git a/spec/unit/util/log.rb b/spec/unit/util/log.rb index 7f37e9f4c..aa00602a9 100755 --- a/spec/unit/util/log.rb +++ b/spec/unit/util/log.rb @@ -60,7 +60,9 @@ describe Puppet::Util::Log do end it "should make available any passed-in tags" do - Puppet::Util::Log.new(:level => "notice", :message => :foo, :tags => %w{foo bar}).tags.should == %w{foo bar} + log = Puppet::Util::Log.new(:level => "notice", :message => :foo, :tags => %w{foo bar}) + log.tags.should be_include("foo") + log.tags.should be_include("bar") end it "should use an passed-in source" do @@ -86,8 +88,7 @@ describe Puppet::Util::Log do end it "should tag itself with its log level" do - pending "not yet" - Puppet::Util::Log.new(:level => "notice", :message => :foo, :tags => %w{one two}).should be_tagged(:one) + Puppet::Util::Log.new(:level => "notice", :message => :foo).should be_tagged(:notice) end it "should return its message when converted to a string" do |