Class Puppet::Util::Log
In: lib/puppet/util/log.rb
Parent: Object

Pass feedback to the user. Log levels are modeled after syslog‘s, and it is expected that that will be the most common log destination. Supports multiple destinations, one of which is a remote server.

Methods

close   close   close   close_all   colorize   console_color   create   destinations   eachlevel   flush   flush   handle   handle   handle   handle   handle   handle   html_color   level   level=   levels   new   new   new   new   new   new   new   newdestination   newdesttype   newmessage   reopen   sendlevel?   source=   to_report   to_s   validlevel?  

Included Modules

Puppet::Util Puppet::Util::Tagging Puppet::Util Puppet::Util::ClassGen

Classes and Modules

Class Puppet::Util::Log::Destination

Constants

RED = {:console => "", :html => "FFA0A0"}
GREEN = {:console => "", :html => "00CD00"}
YELLOW = {:console => "", :html => "FFFF60"}
BLUE = {:console => "", :html => "80A0FF"}
PURPLE = {:console => "", :html => "FFA500"}
CYAN = {:console => "", :html => "40FFFF"}
WHITE = {:console => "", :html => "FFFFFF"}
HRED = {:console => "", :html => "FFA0A0"}
HGREEN = {:console => "", :html => "00CD00"}
HYELLOW = {:console => "", :html => "FFFF60"}
HBLUE = {:console => "", :html => "80A0FF"}
HPURPLE = {:console => "", :html => "FFA500"}
HCYAN = {:console => "", :html => "40FFFF"}
HWHITE = {:console => "", :html => "FFFFFF"}
RESET = {:console => "", :html => "" }

Attributes

file  [RW] 
level  [RW] 
line  [RW] 
message  [RW] 
remote  [RW] 
source  [R] 
time  [RW] 
version  [RW] 

Public Class methods

Reset all logs to basics. Basically just closes all files and undefs all of the other objects.

Create a new log message. The primary role of this method is to avoid creating log messages below the loglevel.

Yield each valid level in turn

Flush any log destinations that support such operations.

Return the current log level.

Set the current log level.

Create a new log destination.

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.

Reopen all of our logs.

Is the passed level a valid log level?

Public Instance methods

If they pass a source in to us, we make sure it is a string, and we retrieve any tags we can.

[Validate]