Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / Log.html
diff --git a/doc/MCollective/Log.html b/doc/MCollective/Log.html
new file mode 100644 (file)
index 0000000..6515f34
--- /dev/null
@@ -0,0 +1,1154 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
+
+       <title>Class: MCollective::Log</title>
+
+       <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
+
+       <script src="../js/jquery.js" type="text/javascript"
+               charset="utf-8"></script>
+       <script src="../js/thickbox-compressed.js" type="text/javascript"
+               charset="utf-8"></script>
+       <script src="../js/quicksearch.js" type="text/javascript"
+               charset="utf-8"></script>
+       <script src="../js/darkfish.js" type="text/javascript"
+               charset="utf-8"></script>
+
+</head>
+<body class="class">
+
+       <div id="metadata">
+               <div id="file-metadata">
+                       <div id="file-list-section" class="section">
+                               <h3 class="section-header">In Files</h3>
+                               <div class="section-body">
+                                       <ul>
+                                       
+                                               <li><a href="../lib/mcollective/log_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
+                                                       class="thickbox" title="lib/mcollective/log.rb">lib/mcollective/log.rb</a></li>
+                                       
+                                       </ul>
+                               </div>
+                       </div>
+
+                       
+               </div>
+
+               <div id="class-metadata">
+
+                       <!-- Parent Class -->
+                       
+                       <div id="parent-class-section" class="section">
+                               <h3 class="section-header">Parent</h3>
+                               
+                               <p class="link"><a href="../Object.html">Object</a></p>
+                               
+                       </div>
+                       
+
+                       <!-- Namespace Contents -->
+                       
+
+                       <!-- Method Quickref -->
+                       
+                       <div id="method-list-section" class="section">
+                               <h3 class="section-header">Methods</h3>
+                               <ul class="link-list">
+                                       
+                                       <li><a href="#M000124">::check_level</a></li>
+                                       
+                                       <li><a href="#M000123">::config_and_check_level</a></li>
+                                       
+                                       <li><a href="#M000131">::configure</a></li>
+                                       
+                                       <li><a href="#M000122">::cycle_level</a></li>
+                                       
+                                       <li><a href="#M000118">::debug</a></li>
+                                       
+                                       <li><a href="#M000120">::error</a></li>
+                                       
+                                       <li><a href="#M000134">::execution_stack</a></li>
+                                       
+                                       <li><a href="#M000119">::fatal</a></li>
+                                       
+                                       <li><a href="#M000133">::from</a></li>
+                                       
+                                       <li><a href="#M000116">::info</a></li>
+                                       
+                                       <li><a href="#M000121">::instance</a></li>
+                                       
+                                       <li><a href="#M000129">::log</a></li>
+                                       
+                                       <li><a href="#M000127">::logexception</a></li>
+                                       
+                                       <li><a href="#M000115">::logger</a></li>
+                                       
+                                       <li><a href="#M000128">::logmsg</a></li>
+                                       
+                                       <li><a href="#M000126">::message_for</a></li>
+                                       
+                                       <li><a href="#M000130">::set_logger</a></li>
+                                       
+                                       <li><a href="#M000132">::unconfigure</a></li>
+                                       
+                                       <li><a href="#M000125">::valid_level?</a></li>
+                                       
+                                       <li><a href="#M000117">::warn</a></li>
+                                       
+                               </ul>
+                       </div>
+                       
+
+                       <!-- Included Modules -->
+                       
+               </div>
+
+               <div id="project-metadata">
+                       
+                       
+                       <div id="fileindex-section" class="section project-section">
+                               <h3 class="section-header">Files</h3>
+                               <ul>
+                               
+                                       <li class="file"><a href="../COPYING.html">COPYING</a></li>
+                               
+                                       <li class="file"><a href="../Gemfile.html">Gemfile</a></li>
+                               
+                                       <li class="file"><a href="../README.html">README</a></li>
+                               
+                                       <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
+                               
+                                       <li class="file"><a href="../etc/client_cfg_dist.html">client.cfg.dist</a></li>
+                               
+                                       <li class="file"><a href="../etc/data-help_erb.html">data-help.erb</a></li>
+                               
+                                       <li class="file"><a href="../etc/discovery-help_erb.html">discovery-help.erb</a></li>
+                               
+                                       <li class="file"><a href="../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
+                               
+                                       <li class="file"><a href="../etc/metadata-help_erb.html">metadata-help.erb</a></li>
+                               
+                                       <li class="file"><a href="../etc/msg-help_erb.html">msg-help.erb</a></li>
+                               
+                                       <li class="file"><a href="../etc/rpc-help_erb.html">rpc-help.erb</a></li>
+                               
+                                       <li class="file"><a href="../etc/server_cfg_dist.html">server.cfg.dist</a></li>
+                               
+                                       <li class="file"><a href="../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
+                               
+                                       <li class="file"><a href="../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
+                               
+                                       <li class="file"><a href="../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
+                               
+                                       <li class="file"><a href="../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
+                               
+                                       <li class="file"><a href="../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
+                               
+                                       <li class="file"><a href="../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
+                               
+                                       <li class="file"><a href="../lib/mcollective/locales/en_yml.html">en.yml</a></li>
+                               
+                                       <li class="file"><a href="../mcollective_init.html">mcollective.init</a></li>
+                               
+                               </ul>
+                       </div>
+                       
+
+                       <div id="classindex-section" class="section project-section">
+                               <h3 class="section-header">Class Index
+                                       <span class="search-toggle"><img src="../images/find.png"
+                                               height="16" width="16" alt="[+]"
+                                               title="show/hide quicksearch" /></span></h3>
+                               <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
+                               <fieldset>
+                                       <legend>Quicksearch</legend>
+                                       <input type="text" name="quicksearch" value=""
+                                               class="quicksearch-field" />
+                               </fieldset>
+                               </form>
+
+                               <ul class="link-list">
+                               
+                                       <li><a href="../MCollective.html">MCollective</a></li>
+                               
+                                       <li><a href="../MCollective/Agent.html">MCollective::Agent</a></li>
+                               
+                                       <li><a href="../MCollective/Agents.html">MCollective::Agents</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
+                               
+                                       <li><a href="../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
+                               
+                                       <li><a href="../MCollective/Application.html">MCollective::Application</a></li>
+                               
+                                       <li><a href="../MCollective/Applications.html">MCollective::Applications</a></li>
+                               
+                                       <li><a href="../MCollective/Cache.html">MCollective::Cache</a></li>
+                               
+                                       <li><a href="../MCollective/Client.html">MCollective::Client</a></li>
+                               
+                                       <li><a href="../MCollective/CodedError.html">MCollective::CodedError</a></li>
+                               
+                                       <li><a href="../MCollective/Config.html">MCollective::Config</a></li>
+                               
+                                       <li><a href="../MCollective/Connector.html">MCollective::Connector</a></li>
+                               
+                                       <li><a href="../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
+                               
+                                       <li><a href="../MCollective/DDL.html">MCollective::DDL</a></li>
+                               
+                                       <li><a href="../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
+                               
+                                       <li><a href="../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
+                               
+                                       <li><a href="../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
+                               
+                                       <li><a href="../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
+                               
+                                       <li><a href="../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
+                               
+                                       <li><a href="../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
+                               
+                                       <li><a href="../MCollective/Data.html">MCollective::Data</a></li>
+                               
+                                       <li><a href="../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
+                               
+                                       <li><a href="../MCollective/Discovery.html">MCollective::Discovery</a></li>
+                               
+                                       <li><a href="../MCollective/Facts.html">MCollective::Facts</a></li>
+                               
+                                       <li><a href="../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Generators.html">MCollective::Generators</a></li>
+                               
+                                       <li><a href="../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
+                               
+                                       <li><a href="../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
+                               
+                                       <li><a href="../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
+                               
+                                       <li><a href="../MCollective/Log.html">MCollective::Log</a></li>
+                               
+                                       <li><a href="../MCollective/Logger.html">MCollective::Logger</a></li>
+                               
+                                       <li><a href="../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
+                               
+                                       <li><a href="../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
+                               
+                                       <li><a href="../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
+                               
+                                       <li><a href="../MCollective/Matcher.html">MCollective::Matcher</a></li>
+                               
+                                       <li><a href="../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
+                               
+                                       <li><a href="../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
+                               
+                                       <li><a href="../MCollective/Message.html">MCollective::Message</a></li>
+                               
+                                       <li><a href="../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
+                               
+                                       <li><a href="../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
+                               
+                                       <li><a href="../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
+                               
+                                       <li><a href="../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
+                               
+                                       <li><a href="../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
+                               
+                                       <li><a href="../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
+                               
+                                       <li><a href="../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
+                               
+                                       <li><a href="../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
+                               
+                                       <li><a href="../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
+                               
+                                       <li><a href="../MCollective/RPC.html">MCollective::RPC</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
+                               
+                                       <li><a href="../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
+                               
+                                       <li><a href="../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
+                               
+                                       <li><a href="../MCollective/RPCError.html">MCollective::RPCError</a></li>
+                               
+                                       <li><a href="../MCollective/Registration.html">MCollective::Registration</a></li>
+                               
+                                       <li><a href="../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
+                               
+                                       <li><a href="../MCollective/Runner.html">MCollective::Runner</a></li>
+                               
+                                       <li><a href="../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
+                               
+                                       <li><a href="../MCollective/SSL.html">MCollective::SSL</a></li>
+                               
+                                       <li><a href="../MCollective/Security.html">MCollective::Security</a></li>
+                               
+                                       <li><a href="../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
+                               
+                                       <li><a href="../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
+                               
+                                       <li><a href="../MCollective/Shell.html">MCollective::Shell</a></li>
+                               
+                                       <li><a href="../MCollective/Translatable.html">MCollective::Translatable</a></li>
+                               
+                                       <li><a href="../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
+                               
+                                       <li><a href="../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
+                               
+                                       <li><a href="../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
+                               
+                                       <li><a href="../MCollective/Util.html">MCollective::Util</a></li>
+                               
+                                       <li><a href="../MCollective/Validator.html">MCollective::Validator</a></li>
+                               
+                                       <li><a href="../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
+                               
+                                       <li><a href="../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
+                               
+                                       <li><a href="../Array.html">Array</a></li>
+                               
+                                       <li><a href="../Dir.html">Dir</a></li>
+                               
+                                       <li><a href="../Object.html">Object</a></li>
+                               
+                                       <li><a href="../String.html">String</a></li>
+                               
+                                       <li><a href="../Symbol.html">Symbol</a></li>
+                               
+                               </ul>
+                               <div id="no-class-search-results" style="display: none;">No matching classes.</div>
+                       </div>
+
+                       
+               </div>
+       </div>
+
+       <div id="documentation">
+               <h1 class="class">MCollective::Log</h1>
+
+               <div id="description">
+                       <p>
+A simple class that allows logging at various levels.
+</p>
+
+               </div>
+
+               <!-- Constants -->
+               
+               <div id="constants-list" class="section">
+                       <h3 class="section-header">Constants</h3>
+                       <dl>
+                       
+                               <dt><a name="VALID_LEVELS">VALID_LEVELS</a></dt>
+                               
+                               <dd class="description missing-docs">(Not documented)</dd>
+                               
+                       
+                       </dl>
+               </div>
+               
+
+               <!-- Attributes -->
+               
+
+               <!-- Methods -->
+               
+               <div id="public-class-method-details" class="method-section section">
+                       <h3 class="section-header">Public Class Methods</h3>
+
+               
+                       <div id="check-level-method" class="method-detail ">
+                               <a name="M000124"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">check_level</span><span
+                                               class="method-args">(level)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="check-level-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 55</span>
+55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_level</span>(<span class="ruby-identifier">level</span>)
+56:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown log level&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_level?</span>(<span class="ruby-identifier">level</span>)
+57:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="config-and-check-level-method" class="method-detail ">
+                               <a name="M000123"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">config_and_check_level</span><span
+                                               class="method-args">(level)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="config-and-check-level-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 49</span>
+49:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+50:         <span class="ruby-identifier">configure</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@configured</span>
+51:         <span class="ruby-identifier">check_level</span>(<span class="ruby-identifier">level</span>)
+52:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">should_log?</span>(<span class="ruby-identifier">level</span>)
+53:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="configure-method" class="method-detail ">
+                               <a name="M000131"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">configure</span><span
+                                               class="method-args">(logger=nil)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+configures the logger class, if the config has not yet been loaded we
+default to the console logging class and do not set @configured so that
+future calls to the log method will keep attempting to configure the logger
+till we eventually get a logging preference from the config module
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="configure-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 130</span>
+130:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>(<span class="ruby-identifier">logger</span>=<span class="ruby-keyword kw">nil</span>)
+131:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">logger</span>
+132:           <span class="ruby-identifier">logger_type</span> = <span class="ruby-value str">&quot;console&quot;</span>
+133: 
+134:           <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+135: 
+136:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">configured</span>
+137:             <span class="ruby-identifier">logger_type</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">logger_type</span>
+138:             <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">true</span>
+139:           <span class="ruby-keyword kw">end</span>
+140: 
+141:           <span class="ruby-identifier">require</span> <span class="ruby-value str">&quot;mcollective/logger/%s_logger&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">logger_type</span>.<span class="ruby-identifier">downcase</span>
+142: 
+143:           <span class="ruby-identifier">logger_class</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Logger</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;%s_logger&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">logger_type</span>.<span class="ruby-identifier">capitalize</span>)
+144: 
+145:           <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger_class</span>.<span class="ruby-identifier">new</span>)
+146:         <span class="ruby-keyword kw">else</span>
+147:           <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger</span>)
+148:           <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">true</span>
+149:         <span class="ruby-keyword kw">end</span>
+150: 
+151: 
+152:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">start</span>
+153:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+154:         <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">false</span>
+155:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Could not start logger: #{e.class} #{e}&quot;</span>
+156:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="cycle-level-method" class="method-detail ">
+                               <a name="M000122"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">cycle_level</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+increments the active log level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="cycle-level-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 45</span>
+45:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle_level</span>
+46:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">cycle_level</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@configured</span>
+47:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="debug-method" class="method-detail ">
+                               <a name="M000118"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">debug</span><span
+                                               class="method-args">(msg)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs at debug level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="debug-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 25</span>
+25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug</span>(<span class="ruby-identifier">msg</span>)
+26:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">msg</span>)
+27:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="error-method" class="method-detail ">
+                               <a name="M000120"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">error</span><span
+                                               class="method-args">(msg)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs at error level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="error-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">msg</span>)
+36:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:error</span>, <span class="ruby-identifier">msg</span>)
+37:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="execution-stack-method" class="method-detail ">
+                               <a name="M000134"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">execution_stack</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+this method is here to facilitate testing
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="execution-stack-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 170</span>
+170:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execution_stack</span>
+171:         <span class="ruby-identifier">caller</span>
+172:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="fatal-method" class="method-detail ">
+                               <a name="M000119"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">fatal</span><span
+                                               class="method-args">(msg)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs at fatal level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="fatal-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 30</span>
+30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">msg</span>)
+31:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:fatal</span>, <span class="ruby-identifier">msg</span>)
+32:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="from-method" class="method-detail ">
+                               <a name="M000133"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">from</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+figures out the filename that called us
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="from-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 164</span>
+164:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from</span>
+165:         <span class="ruby-identifier">path</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span> = <span class="ruby-identifier">execution_stack</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/:(\d+)/</span>)
+166:         <span class="ruby-value str">&quot;%s:%s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>), <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span>]
+167:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="info-method" class="method-detail ">
+                               <a name="M000116"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">info</span><span
+                                               class="method-args">(msg)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs at info level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="info-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 15</span>
+15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">info</span>(<span class="ruby-identifier">msg</span>)
+16:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:info</span>, <span class="ruby-identifier">msg</span>)
+17:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="instance-method" class="method-detail ">
+                               <a name="M000121"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">instance</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+handle old code that relied on this class being a singleton
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="instance-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 40</span>
+40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance</span>
+41:         <span class="ruby-keyword kw">self</span>
+42:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="log-method" class="method-detail ">
+                               <a name="M000129"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">log</span><span
+                                               class="method-args">(level, msg, origin=nil)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+logs a message at a certain level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="log-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 106</span>
+106:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">origin</span>=<span class="ruby-keyword kw">nil</span>)
+107:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+108: 
+109:         <span class="ruby-identifier">origin</span> = <span class="ruby-identifier">from</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">origin</span>
+110: 
+111:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@logger</span>
+112:           <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">origin</span>, <span class="ruby-identifier">msg</span>)
+113:         <span class="ruby-keyword kw">else</span>
+114:           <span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M:%S&quot;</span>)
+115: 
+116:           <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{t}: #{level}: #{origin}: #{msg}&quot;</span>
+117:         <span class="ruby-keyword kw">end</span>
+118:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="logexception-method" class="method-detail ">
+                               <a name="M000127"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">logexception</span><span
+                                               class="method-args">(msgid, level, e, backtrace=false, args={})</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="logexception-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 67</span>
+67:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">backtrace</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">args</span>={})
+68:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+69: 
+70:         <span class="ruby-identifier">path</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/:(\d+)/</span>)
+71:         <span class="ruby-identifier">origin</span> = <span class="ruby-value str">&quot;%s:%s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>), <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span>]
+72: 
+73:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">CodedError</span>)
+74:           <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">code</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>]
+75:         <span class="ruby-keyword kw">else</span>
+76:           <span class="ruby-identifier">error_string</span> = <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>]
+77:           <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error_string</span>))
+78:         <span class="ruby-keyword kw">end</span>
+79: 
+80:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">origin</span>)
+81: 
+82:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">backtrace</span>
+83:           <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
+84:             <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-value str">&quot;%s:          %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">line</span>], <span class="ruby-identifier">origin</span>)
+85:           <span class="ruby-keyword kw">end</span>
+86:         <span class="ruby-keyword kw">end</span>
+87:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="logger-method" class="method-detail ">
+                               <a name="M000115"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">logger</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Obtain the class name of the currently configured logger
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="logger-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 10</span>
+10:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
+11:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">class</span>
+12:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="logmsg-method" class="method-detail ">
+                               <a name="M000128"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">logmsg</span><span
+                                               class="method-args">(msgid, default, level, args={})</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs a message at a certain level, the message must be a token that will be
+looked up from the i18n localization database
+</p>
+<p>
+Messages can interprolate strings from the args hash, a message with
+&#8220;foo %{bar}&#8221; in the localization database will use args[:bar]
+for the value there, the interprolation is handled by the i18n library
+itself
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="logmsg-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 97</span>
+ 97:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logmsg</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>={})
+ 98:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+ 99: 
+100:         <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, {<span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">default</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">args</span>))
+101: 
+102:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>)
+103:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="message-for-method" class="method-detail ">
+                               <a name="M000126"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">message_for</span><span
+                                               class="method-args">(msgid, args={})</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="message-for-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 63</span>
+63:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>={})
+64:         <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-constant">Util</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>)]
+65:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="set-logger-method" class="method-detail ">
+                               <a name="M000130"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">set_logger</span><span
+                                               class="method-args">(logger)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+sets the logger class to use
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="set-logger-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 121</span>
+121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger</span>)
+122:         <span class="ruby-ivar">@logger</span> = <span class="ruby-identifier">logger</span>
+123:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="unconfigure-method" class="method-detail ">
+                               <a name="M000132"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">unconfigure</span><span
+                                               class="method-args">()</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="unconfigure-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 158</span>
+158:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unconfigure</span>
+159:         <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">false</span>
+160:         <span class="ruby-identifier">set_logger</span>(<span class="ruby-keyword kw">nil</span>)
+161:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="valid-level--method" class="method-detail ">
+                               <a name="M000125"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">valid_level?</span><span
+                                               class="method-args">(level)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p class="missing-docs">(Not documented)</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="valid-level--source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 59</span>
+59:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_level?</span>(<span class="ruby-identifier">level</span>)
+60:         <span class="ruby-constant">VALID_LEVELS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">level</span>)
+61:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+                       <div id="warn-method" class="method-detail ">
+                               <a name="M000117"></a>
+
+                               <div class="method-heading">
+                               
+                                       <span class="method-name">warn</span><span
+                                               class="method-args">(msg)</span>
+                                       <span class="method-click-advice">click to toggle source</span>
+                               
+                               </div>
+
+                               <div class="method-description">
+                                       
+                                       <p>
+Logs at warn level
+</p>
+                                       
+
+                                       
+                                       <div class="method-source-code"
+                                               id="warn-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 20</span>
+20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">warn</span>(<span class="ruby-identifier">msg</span>)
+21:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">msg</span>)
+22:       <span class="ruby-keyword kw">end</span></pre>
+                                       </div>
+                                       
+                               </div>
+
+                               
+                       </div>
+
+               
+               </div>
+       
+
+       </div>
+
+
+       <div id="rdoc-debugging-section-dump" class="debugging-section">
+       
+               <p>Disabled; run with --debug to generate this.</p>
+       
+       </div>
+
+       <div id="validator-badges">
+               <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+               <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
+                       Rdoc Generator</a> 1.1.6</small>.</p>
+       </div>
+
+</body>
+</html>
+