Update version according to OSCI-883
[packages/precise/mcollective.git] / doc / MCollective / Logger / Base.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
6         <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
8         <title>Class: MCollective::Logger::Base</title>
9
10         <link rel="stylesheet" href="../../rdoc.css" type="text/css" media="screen" />
11
12         <script src="../../js/jquery.js" type="text/javascript"
13                 charset="utf-8"></script>
14         <script src="../../js/thickbox-compressed.js" type="text/javascript"
15                 charset="utf-8"></script>
16         <script src="../../js/quicksearch.js" type="text/javascript"
17                 charset="utf-8"></script>
18         <script src="../../js/darkfish.js" type="text/javascript"
19                 charset="utf-8"></script>
20
21 </head>
22 <body class="class">
23
24         <div id="metadata">
25                 <div id="file-metadata">
26                         <div id="file-list-section" class="section">
27                                 <h3 class="section-header">In Files</h3>
28                                 <div class="section-body">
29                                         <ul>
30                                         
31                                                 <li><a href="../../lib/mcollective/logger/base_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32                                                         class="thickbox" title="lib/mcollective/logger/base.rb">lib/mcollective/logger/base.rb</a></li>
33                                         
34                                         </ul>
35                                 </div>
36                         </div>
37
38                         
39                 </div>
40
41                 <div id="class-metadata">
42
43                         <!-- Parent Class -->
44                         
45                         <div id="parent-class-section" class="section">
46                                 <h3 class="section-header">Parent</h3>
47                                 
48                                 <p class="link"><a href="../../Object.html">Object</a></p>
49                                 
50                         </div>
51                         
52
53                         <!-- Namespace Contents -->
54                         
55
56                         <!-- Method Quickref -->
57                         
58                         <div id="method-list-section" class="section">
59                                 <h3 class="section-header">Methods</h3>
60                                 <ul class="link-list">
61                                         
62                                         <li><a href="#M000166">::new</a></li>
63                                         
64                                         <li><a href="#M000168">#cycle_level</a></li>
65                                         
66                                         <li><a href="#M000171">#get_next_level</a></li>
67                                         
68                                         <li><a href="#M000173">#log</a></li>
69                                         
70                                         <li><a href="#M000170">#map_level</a></li>
71                                         
72                                         <li><a href="#M000169">#set_level</a></li>
73                                         
74                                         <li><a href="#M000167">#should_log?</a></li>
75                                         
76                                         <li><a href="#M000174">#start</a></li>
77                                         
78                                         <li><a href="#M000172">#valid_levels</a></li>
79                                         
80                                 </ul>
81                         </div>
82                         
83
84                         <!-- Included Modules -->
85                         
86                 </div>
87
88                 <div id="project-metadata">
89                         
90                         
91                         <div id="fileindex-section" class="section project-section">
92                                 <h3 class="section-header">Files</h3>
93                                 <ul>
94                                 
95                                         <li class="file"><a href="../../COPYING.html">COPYING</a></li>
96                                 
97                                         <li class="file"><a href="../../Gemfile.html">Gemfile</a></li>
98                                 
99                                         <li class="file"><a href="../../README.html">README</a></li>
100                                 
101                                         <li class="file"><a href="../../Rakefile.html">Rakefile</a></li>
102                                 
103                                         <li class="file"><a href="../../etc/client_cfg_dist.html">client.cfg.dist</a></li>
104                                 
105                                         <li class="file"><a href="../../etc/data-help_erb.html">data-help.erb</a></li>
106                                 
107                                         <li class="file"><a href="../../etc/discovery-help_erb.html">discovery-help.erb</a></li>
108                                 
109                                         <li class="file"><a href="../../etc/facts_yaml_dist.html">facts.yaml.dist</a></li>
110                                 
111                                         <li class="file"><a href="../../etc/metadata-help_erb.html">metadata-help.erb</a></li>
112                                 
113                                         <li class="file"><a href="../../etc/msg-help_erb.html">msg-help.erb</a></li>
114                                 
115                                         <li class="file"><a href="../../etc/rpc-help_erb.html">rpc-help.erb</a></li>
116                                 
117                                         <li class="file"><a href="../../etc/server_cfg_dist.html">server.cfg.dist</a></li>
118                                 
119                                         <li class="file"><a href="../../etc/ssl/PLACEHOLDER.html">PLACEHOLDER</a></li>
120                                 
121                                         <li class="file"><a href="../../etc/ssl/clients/PLACEHOLDER.html">PLACEHOLDER</a></li>
122                                 
123                                         <li class="file"><a href="../../lib/mcollective/generators/templates/action_snippet_erb.html">action_snippet.erb</a></li>
124                                 
125                                         <li class="file"><a href="../../lib/mcollective/generators/templates/data_input_snippet_erb.html">data_input_snippet.erb</a></li>
126                                 
127                                         <li class="file"><a href="../../lib/mcollective/generators/templates/ddl_erb.html">ddl.erb</a></li>
128                                 
129                                         <li class="file"><a href="../../lib/mcollective/generators/templates/plugin_erb.html">plugin.erb</a></li>
130                                 
131                                         <li class="file"><a href="../../lib/mcollective/locales/en_yml.html">en.yml</a></li>
132                                 
133                                         <li class="file"><a href="../../mcollective_init.html">mcollective.init</a></li>
134                                 
135                                 </ul>
136                         </div>
137                         
138
139                         <div id="classindex-section" class="section project-section">
140                                 <h3 class="section-header">Class Index
141                                         <span class="search-toggle"><img src="../../images/find.png"
142                                                 height="16" width="16" alt="[+]"
143                                                 title="show/hide quicksearch" /></span></h3>
144                                 <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
145                                 <fieldset>
146                                         <legend>Quicksearch</legend>
147                                         <input type="text" name="quicksearch" value=""
148                                                 class="quicksearch-field" />
149                                 </fieldset>
150                                 </form>
151
152                                 <ul class="link-list">
153                                 
154                                         <li><a href="../../MCollective.html">MCollective</a></li>
155                                 
156                                         <li><a href="../../MCollective/Agent.html">MCollective::Agent</a></li>
157                                 
158                                         <li><a href="../../MCollective/Agents.html">MCollective::Agents</a></li>
159                                 
160                                         <li><a href="../../MCollective/Aggregate.html">MCollective::Aggregate</a></li>
161                                 
162                                         <li><a href="../../MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a></li>
163                                 
164                                         <li><a href="../../MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a></li>
165                                 
166                                         <li><a href="../../MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a></li>
167                                 
168                                         <li><a href="../../MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a></li>
169                                 
170                                         <li><a href="../../MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a></li>
171                                 
172                                         <li><a href="../../MCollective/Application.html">MCollective::Application</a></li>
173                                 
174                                         <li><a href="../../MCollective/Applications.html">MCollective::Applications</a></li>
175                                 
176                                         <li><a href="../../MCollective/Cache.html">MCollective::Cache</a></li>
177                                 
178                                         <li><a href="../../MCollective/Client.html">MCollective::Client</a></li>
179                                 
180                                         <li><a href="../../MCollective/CodedError.html">MCollective::CodedError</a></li>
181                                 
182                                         <li><a href="../../MCollective/Config.html">MCollective::Config</a></li>
183                                 
184                                         <li><a href="../../MCollective/Connector.html">MCollective::Connector</a></li>
185                                 
186                                         <li><a href="../../MCollective/Connector/Base.html">MCollective::Connector::Base</a></li>
187                                 
188                                         <li><a href="../../MCollective/DDL.html">MCollective::DDL</a></li>
189                                 
190                                         <li><a href="../../MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a></li>
191                                 
192                                         <li><a href="../../MCollective/DDL/Base.html">MCollective::DDL::Base</a></li>
193                                 
194                                         <li><a href="../../MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a></li>
195                                 
196                                         <li><a href="../../MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a></li>
197                                 
198                                         <li><a href="../../MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a></li>
199                                 
200                                         <li><a href="../../MCollective/DDLValidationError.html">MCollective::DDLValidationError</a></li>
201                                 
202                                         <li><a href="../../MCollective/Data.html">MCollective::Data</a></li>
203                                 
204                                         <li><a href="../../MCollective/Data/Base.html">MCollective::Data::Base</a></li>
205                                 
206                                         <li><a href="../../MCollective/Data/Result.html">MCollective::Data::Result</a></li>
207                                 
208                                         <li><a href="../../MCollective/Discovery.html">MCollective::Discovery</a></li>
209                                 
210                                         <li><a href="../../MCollective/Facts.html">MCollective::Facts</a></li>
211                                 
212                                         <li><a href="../../MCollective/Facts/Base.html">MCollective::Facts::Base</a></li>
213                                 
214                                         <li><a href="../../MCollective/Generators.html">MCollective::Generators</a></li>
215                                 
216                                         <li><a href="../../MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a></li>
217                                 
218                                         <li><a href="../../MCollective/Generators/Base.html">MCollective::Generators::Base</a></li>
219                                 
220                                         <li><a href="../../MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a></li>
221                                 
222                                         <li><a href="../../MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a></li>
223                                 
224                                         <li><a href="../../MCollective/Log.html">MCollective::Log</a></li>
225                                 
226                                         <li><a href="../../MCollective/Logger.html">MCollective::Logger</a></li>
227                                 
228                                         <li><a href="../../MCollective/Logger/Base.html">MCollective::Logger::Base</a></li>
229                                 
230                                         <li><a href="../../MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a></li>
231                                 
232                                         <li><a href="../../MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a></li>
233                                 
234                                         <li><a href="../../MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a></li>
235                                 
236                                         <li><a href="../../MCollective/Matcher.html">MCollective::Matcher</a></li>
237                                 
238                                         <li><a href="../../MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a></li>
239                                 
240                                         <li><a href="../../MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a></li>
241                                 
242                                         <li><a href="../../MCollective/Message.html">MCollective::Message</a></li>
243                                 
244                                         <li><a href="../../MCollective/MissingRPCData.html">MCollective::MissingRPCData</a></li>
245                                 
246                                         <li><a href="../../MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a></li>
247                                 
248                                         <li><a href="../../MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a></li>
249                                 
250                                         <li><a href="../../MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a></li>
251                                 
252                                         <li><a href="../../MCollective/Optionparser.html">MCollective::Optionparser</a></li>
253                                 
254                                         <li><a href="../../MCollective/PluginManager.html">MCollective::PluginManager</a></li>
255                                 
256                                         <li><a href="../../MCollective/PluginPackager.html">MCollective::PluginPackager</a></li>
257                                 
258                                         <li><a href="../../MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a></li>
259                                 
260                                         <li><a href="../../MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a></li>
261                                 
262                                         <li><a href="../../MCollective/RPC.html">MCollective::RPC</a></li>
263                                 
264                                         <li><a href="../../MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a></li>
265                                 
266                                         <li><a href="../../MCollective/RPC/Agent.html">MCollective::RPC::Agent</a></li>
267                                 
268                                         <li><a href="../../MCollective/RPC/Audit.html">MCollective::RPC::Audit</a></li>
269                                 
270                                         <li><a href="../../MCollective/RPC/Client.html">MCollective::RPC::Client</a></li>
271                                 
272                                         <li><a href="../../MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a></li>
273                                 
274                                         <li><a href="../../MCollective/RPC/Progress.html">MCollective::RPC::Progress</a></li>
275                                 
276                                         <li><a href="../../MCollective/RPC/Reply.html">MCollective::RPC::Reply</a></li>
277                                 
278                                         <li><a href="../../MCollective/RPC/Request.html">MCollective::RPC::Request</a></li>
279                                 
280                                         <li><a href="../../MCollective/RPC/Result.html">MCollective::RPC::Result</a></li>
281                                 
282                                         <li><a href="../../MCollective/RPC/Stats.html">MCollective::RPC::Stats</a></li>
283                                 
284                                         <li><a href="../../MCollective/RPCAborted.html">MCollective::RPCAborted</a></li>
285                                 
286                                         <li><a href="../../MCollective/RPCError.html">MCollective::RPCError</a></li>
287                                 
288                                         <li><a href="../../MCollective/Registration.html">MCollective::Registration</a></li>
289                                 
290                                         <li><a href="../../MCollective/Registration/Base.html">MCollective::Registration::Base</a></li>
291                                 
292                                         <li><a href="../../MCollective/Runner.html">MCollective::Runner</a></li>
293                                 
294                                         <li><a href="../../MCollective/RunnerStats.html">MCollective::RunnerStats</a></li>
295                                 
296                                         <li><a href="../../MCollective/SSL.html">MCollective::SSL</a></li>
297                                 
298                                         <li><a href="../../MCollective/Security.html">MCollective::Security</a></li>
299                                 
300                                         <li><a href="../../MCollective/Security/Base.html">MCollective::Security::Base</a></li>
301                                 
302                                         <li><a href="../../MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a></li>
303                                 
304                                         <li><a href="../../MCollective/Shell.html">MCollective::Shell</a></li>
305                                 
306                                         <li><a href="../../MCollective/Translatable.html">MCollective::Translatable</a></li>
307                                 
308                                         <li><a href="../../MCollective/UnixDaemon.html">MCollective::UnixDaemon</a></li>
309                                 
310                                         <li><a href="../../MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a></li>
311                                 
312                                         <li><a href="../../MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a></li>
313                                 
314                                         <li><a href="../../MCollective/Util.html">MCollective::Util</a></li>
315                                 
316                                         <li><a href="../../MCollective/Validator.html">MCollective::Validator</a></li>
317                                 
318                                         <li><a href="../../MCollective/ValidatorError.html">MCollective::ValidatorError</a></li>
319                                 
320                                         <li><a href="../../MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a></li>
321                                 
322                                         <li><a href="../../Array.html">Array</a></li>
323                                 
324                                         <li><a href="../../Dir.html">Dir</a></li>
325                                 
326                                         <li><a href="../../Object.html">Object</a></li>
327                                 
328                                         <li><a href="../../String.html">String</a></li>
329                                 
330                                         <li><a href="../../Symbol.html">Symbol</a></li>
331                                 
332                                 </ul>
333                                 <div id="no-class-search-results" style="display: none;">No matching classes.</div>
334                         </div>
335
336                         
337                 </div>
338         </div>
339
340         <div id="documentation">
341                 <h1 class="class">MCollective::Logger::Base</h1>
342
343                 <div id="description">
344                         <p>
345 A base class for logging providers.
346 </p>
347 <p>
348 Logging providers should provide the following:
349 </p>
350 <pre>
351    * start - all you need to do to setup your logging
352    * set_logging_level - set your logging to :info, :warn, etc
353    * valid_levels - a hash of maps from :info to your internal level name
354    * log - what needs to be done to log a specific message
355 </pre>
356
357                 </div>
358
359                 <!-- Constants -->
360                 
361
362                 <!-- Attributes -->
363                 
364                 <div id="attribute-method-details" class="method-section section">
365                         <h3 class="section-header">Attributes</h3>
366
367                         
368                         <div id="active-level-attribute-method" class="method-detail">
369                                 <a name="active_level"></a>
370                                 
371                                 <div class="method-heading attribute-method-heading">
372                                         <span class="method-name">active_level</span><span
373                                                 class="attribute-access-type">[R]</span>
374                                 </div>
375
376                                 <div class="method-description">
377                                 
378                                 <p class="missing-docs">(Not documented)</p>
379                                 
380                                 </div>
381                         </div>
382                         
383                 </div>
384                 
385
386                 <!-- Methods -->
387                 
388                 <div id="public-class-method-details" class="method-section section">
389                         <h3 class="section-header">Public Class Methods</h3>
390
391                 
392                         <div id="new-method" class="method-detail ">
393                                 <a name="M000166"></a>
394
395                                 <div class="method-heading">
396                                 
397                                         <span class="method-name">new</span><span
398                                                 class="method-args">()</span>
399                                         <span class="method-click-advice">click to toggle source</span>
400                                 
401                                 </div>
402
403                                 <div class="method-description">
404                                         
405                                         <p class="missing-docs">(Not documented)</p>
406                                         
407
408                                         
409                                         <div class="method-source-code"
410                                                 id="new-source">
411 <pre>
412     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 14</span>
413 14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
414 15:         <span class="ruby-ivar">@known_levels</span> = [<span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:info</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:fatal</span>]
415 16: 
416 17:         <span class="ruby-comment cmt"># Sanity check the class that impliments the logging</span>
417 18:         <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lvl</span><span class="ruby-operator">|</span>
418 19:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Logger class did not specify a map for #{lvl}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_levels</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">lvl</span>)
419 20:         <span class="ruby-keyword kw">end</span>
420 21:       <span class="ruby-keyword kw">end</span></pre>
421                                         </div>
422                                         
423                                 </div>
424
425                                 
426                         </div>
427
428                 
429                 </div>
430         
431                 <div id="public-instance-method-details" class="method-section section">
432                         <h3 class="section-header">Public Instance Methods</h3>
433
434                 
435                         <div id="cycle-level-method" class="method-detail ">
436                                 <a name="M000168"></a>
437
438                                 <div class="method-heading">
439                                 
440                                         <span class="method-name">cycle_level</span><span
441                                                 class="method-args">()</span>
442                                         <span class="method-click-advice">click to toggle source</span>
443                                 
444                                 </div>
445
446                                 <div class="method-description">
447                                         
448                                         <p>
449 Figures out the next level and sets it
450 </p>
451                                         
452
453                                         
454                                         <div class="method-source-code"
455                                                 id="cycle-level-source">
456 <pre>
457     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 28</span>
458 28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle_level</span>
459 29:         <span class="ruby-identifier">lvl</span> = <span class="ruby-identifier">get_next_level</span>
460 30:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">lvl</span>)
461 31: 
462 32:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">lvl</span>, <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-node">&quot;Logging level is now #{lvl.to_s.upcase}&quot;</span>)
463 33:       <span class="ruby-keyword kw">end</span></pre>
464                                         </div>
465                                         
466                                 </div>
467
468                                 
469                         </div>
470
471                 
472                         <div id="set-level-method" class="method-detail ">
473                                 <a name="M000169"></a>
474
475                                 <div class="method-heading">
476                                 
477                                         <span class="method-name">set_level</span><span
478                                                 class="method-args">(level)</span>
479                                         <span class="method-click-advice">click to toggle source</span>
480                                 
481                                 </div>
482
483                                 <div class="method-description">
484                                         
485                                         <p>
486 Sets a new level and record it in @<a
487 href="Base.html#active_level">active_level</a>
488 </p>
489                                         
490
491                                         
492                                         <div class="method-source-code"
493                                                 id="set-level-source">
494 <pre>
495     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 36</span>
496 36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">level</span>)
497 37:         <span class="ruby-identifier">set_logging_level</span>(<span class="ruby-identifier">level</span>)
498 38:         <span class="ruby-ivar">@active_level</span> = <span class="ruby-identifier">level</span>.<span class="ruby-identifier">to_sym</span>
499 39:       <span class="ruby-keyword kw">end</span></pre>
500                                         </div>
501                                         
502                                 </div>
503
504                                 
505                         </div>
506
507                 
508                         <div id="should-log--method" class="method-detail ">
509                                 <a name="M000167"></a>
510
511                                 <div class="method-heading">
512                                 
513                                         <span class="method-name">should_log?</span><span
514                                                 class="method-args">(level)</span>
515                                         <span class="method-click-advice">click to toggle source</span>
516                                 
517                                 </div>
518
519                                 <div class="method-description">
520                                         
521                                         <p class="missing-docs">(Not documented)</p>
522                                         
523
524                                         
525                                         <div class="method-source-code"
526                                                 id="should-log--source">
527 <pre>
528     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 23</span>
529 23:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should_log?</span>(<span class="ruby-identifier">level</span>)
530 24:         <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">level</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@active_level</span>)
531 25:       <span class="ruby-keyword kw">end</span></pre>
532                                         </div>
533                                         
534                                 </div>
535
536                                 
537                         </div>
538
539                 
540                 </div>
541         
542                 <div id="private-instance-method-details" class="method-section section">
543                         <h3 class="section-header">Private Instance Methods</h3>
544
545                 
546                         <div id="get-next-level-method" class="method-detail ">
547                                 <a name="M000171"></a>
548
549                                 <div class="method-heading">
550                                 
551                                         <span class="method-name">get_next_level</span><span
552                                                 class="method-args">()</span>
553                                         <span class="method-click-advice">click to toggle source</span>
554                                 
555                                 </div>
556
557                                 <div class="method-description">
558                                         
559                                         <p>
560 Gets the next level in the list, cycles down to the firt once it reaches
561 the end
562 </p>
563                                         
564
565                                         
566                                         <div class="method-source-code"
567                                                 id="get-next-level-source">
568 <pre>
569     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 49</span>
570 49:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_next_level</span>
571 50:         <span class="ruby-comment cmt"># if all else fails, always go to debug mode</span>
572 51:         <span class="ruby-identifier">nextlvl</span> = <span class="ruby-identifier">:debug</span>
573 52: 
574 53:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@active_level</span>) <span class="ruby-operator">==</span> (<span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
575 54:           <span class="ruby-identifier">nextlvl</span> = <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">first</span>
576 55:         <span class="ruby-keyword kw">else</span>
577 56:           <span class="ruby-identifier">idx</span> = <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@active_level</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
578 57:           <span class="ruby-identifier">nextlvl</span> = <span class="ruby-ivar">@known_levels</span>[<span class="ruby-identifier">idx</span>]
579 58:         <span class="ruby-keyword kw">end</span>
580 59: 
581 60:         <span class="ruby-identifier">nextlvl</span>
582 61:       <span class="ruby-keyword kw">end</span></pre>
583                                         </div>
584                                         
585                                 </div>
586
587                                 
588                         </div>
589
590                 
591                         <div id="log-method" class="method-detail ">
592                                 <a name="M000173"></a>
593
594                                 <div class="method-heading">
595                                 
596                                         <span class="method-name">log</span><span
597                                                 class="method-args">(level, from, msg)</span>
598                                         <span class="method-click-advice">click to toggle source</span>
599                                 
600                                 </div>
601
602                                 <div class="method-description">
603                                         
604                                         <p class="missing-docs">(Not documented)</p>
605                                         
606
607                                         
608                                         <div class="method-source-code"
609                                                 id="log-source">
610 <pre>
611     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 68</span>
612 68:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">msg</span>)
613 69:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The logging class did not supply a log method&quot;</span>
614 70:       <span class="ruby-keyword kw">end</span></pre>
615                                         </div>
616                                         
617                                 </div>
618
619                                 
620                         </div>
621
622                 
623                         <div id="map-level-method" class="method-detail ">
624                                 <a name="M000170"></a>
625
626                                 <div class="method-heading">
627                                 
628                                         <span class="method-name">map_level</span><span
629                                                 class="method-args">(level)</span>
630                                         <span class="method-click-advice">click to toggle source</span>
631                                 
632                                 </div>
633
634                                 <div class="method-description">
635                                         
636                                         <p class="missing-docs">(Not documented)</p>
637                                         
638
639                                         
640                                         <div class="method-source-code"
641                                                 id="map-level-source">
642 <pre>
643     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 42</span>
644 42:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_level</span>(<span class="ruby-identifier">level</span>)
645 43:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Logger class do not know how to handle #{level} messages&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_levels</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">level</span>.<span class="ruby-identifier">to_sym</span>)
646 44: 
647 45:         <span class="ruby-identifier">valid_levels</span>[<span class="ruby-identifier">level</span>.<span class="ruby-identifier">to_sym</span>]
648 46:       <span class="ruby-keyword kw">end</span></pre>
649                                         </div>
650                                         
651                                 </div>
652
653                                 
654                         </div>
655
656                 
657                         <div id="start-method" class="method-detail ">
658                                 <a name="M000174"></a>
659
660                                 <div class="method-heading">
661                                 
662                                         <span class="method-name">start</span><span
663                                                 class="method-args">()</span>
664                                         <span class="method-click-advice">click to toggle source</span>
665                                 
666                                 </div>
667
668                                 <div class="method-description">
669                                         
670                                         <p class="missing-docs">(Not documented)</p>
671                                         
672
673                                         
674                                         <div class="method-source-code"
675                                                 id="start-source">
676 <pre>
677     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 72</span>
678 72:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
679 73:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The logging class did not supply a start method&quot;</span>
680 74:       <span class="ruby-keyword kw">end</span></pre>
681                                         </div>
682                                         
683                                 </div>
684
685                                 
686                         </div>
687
688                 
689                         <div id="valid-levels-method" class="method-detail ">
690                                 <a name="M000172"></a>
691
692                                 <div class="method-heading">
693                                 
694                                         <span class="method-name">valid_levels</span><span
695                                                 class="method-args">()</span>
696                                         <span class="method-click-advice">click to toggle source</span>
697                                 
698                                 </div>
699
700                                 <div class="method-description">
701                                         
702                                         <p>
703 Abstract methods to ensure the logging implimentations supply what they
704 should
705 </p>
706                                         
707
708                                         
709                                         <div class="method-source-code"
710                                                 id="valid-levels-source">
711 <pre>
712     <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 64</span>
713 64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_levels</span>
714 65:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The logging class did not supply a valid_levels method&quot;</span>
715 66:       <span class="ruby-keyword kw">end</span></pre>
716                                         </div>
717                                         
718                                 </div>
719
720                                 
721                         </div>
722
723                 
724                 </div>
725         
726
727         </div>
728
729
730         <div id="rdoc-debugging-section-dump" class="debugging-section">
731         
732                 <p>Disabled; run with --debug to generate this.</p>
733         
734         </div>
735
736         <div id="validator-badges">
737                 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
738                 <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
739                         Rdoc Generator</a> 1.1.6</small>.</p>
740         </div>
741
742 </body>
743 </html>
744