summaryrefslogtreecommitdiffstats
path: root/lib/puppet/log.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-06-29 03:11:06 +0000
committerLuke Kanies <luke@madstop.com>2005-06-29 03:11:06 +0000
commit0c4254a9c1bad795a8bcc895cff74b6dd961ba44 (patch)
tree2d512a90e147d020486ff71591ad64202814ac06 /lib/puppet/log.rb
parent573d3018a67521f37dbbd46e86c7d1d8b7bc2703 (diff)
downloadpuppet-0c4254a9c1bad795a8bcc895cff74b6dd961ba44.tar.gz
puppet-0c4254a9c1bad795a8bcc895cff74b6dd961ba44.tar.xz
puppet-0c4254a9c1bad795a8bcc895cff74b6dd961ba44.zip
metric testing and graphing now works in the library, although nothing has been done in the language
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@314 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/log.rb')
-rw-r--r--lib/puppet/log.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb
index 9cfb80193..5f77e623c 100644
--- a/lib/puppet/log.rb
+++ b/lib/puppet/log.rb
@@ -47,12 +47,14 @@ module Puppet
def Log.create(level,*ary)
msg = ary.join(" ")
- if @@levels.index(@@loglevel) >= @@levels.index(level)
- Puppet::Log.new(
+ if @@levels.index(level) >= @@loglevel
+ return Puppet::Log.new(
:level => level,
:source => "Puppet",
:message => msg
)
+ else
+ return nil
end
end
@@ -86,11 +88,11 @@ module Puppet
level = level.intern
end
- unless @@loglevels.include?(level)
+ unless @@levels.include?(level)
raise "Invalid loglevel %s" % level
end
- @@loglevel = @@loglevels.index(level)
+ @@loglevel = @@levels.index(level)
end
def Log.newmessage(msg)