diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-24 06:37:00 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-24 06:37:00 +0000 |
commit | 9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec (patch) | |
tree | 02e58bed60b09dae80c5288618b233e91b64a84c /lib/puppet/log.rb | |
parent | ae2575b45de1e8f4c0ec956cebe0eed2bafbcf57 (diff) | |
download | puppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.tar.gz puppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.tar.xz puppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.zip |
Fixing some logging issues
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@849 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/log.rb')
-rw-r--r-- | lib/puppet/log.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb index 24a694be4..65043a463 100644 --- a/lib/puppet/log.rb +++ b/lib/puppet/log.rb @@ -80,6 +80,10 @@ module Puppet end end + def Log.destinations + return @destinations.keys + end + # Yield each valid level in turn def Log.eachlevel @levels.each { |level| yield level } @@ -159,11 +163,11 @@ module Puppet end end - # Route the actual message. FIXME There are lots of things this method should - # do, like caching, storing messages when there are not yet destinations, - # a bit more. - # It's worth noting that there's a potential for a loop here, if - # the machine somehow gets the destination set as itself. + # Route the actual message. FIXME There are lots of things this method + # should do, like caching, storing messages when there are not yet + # destinations, a bit more. It's worth noting that there's a potential + # for a loop here, if the machine somehow gets the destination set as + # itself. def Log.newmessage(msg) if @levels.index(msg.level) < @loglevel return @@ -179,7 +183,9 @@ module Puppet dest.send(msg.level, msg.to_s.gsub("%", '%%')) else dest.send(msg.level, "(%s) %s" % - [msg.source.to_s.gsub("%", ""), msg.to_s.gsub("%", '%%')] + [msg.source.to_s.gsub("%", ""), + msg.to_s.gsub("%", '%%') + ] ) end when File: |