~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to lib/puppet/util/log/destinations.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
  HWHITE  = {:console => "", :html => "FFFFFF"}
97
97
  RESET   = {:console => "",    :html => ""      }
98
98
 
99
 
  @@colormap = {
 
99
  Colormap = {
100
100
    :debug => WHITE,
101
101
    :info => GREEN,
102
102
    :notice => CYAN,
117
117
  end
118
118
 
119
119
  def console_color(level, str)
120
 
    @@colormap[level][:console] + str + RESET[:console]
 
120
    Colormap[level][:console] + str + RESET[:console]
121
121
  end
122
122
 
123
123
  def html_color(level, str)
124
 
    %{<span style="color: %s">%s</span>} % [@@colormap[level][:html], str]
 
124
    %{<span style="color: %s">%s</span>} % [Colormap[level][:html], str]
125
125
  end
126
126
 
127
127
  def initialize
205
205
end
206
206
 
207
207
# Log to an array, just for testing.
 
208
module Puppet::Test
 
209
  class LogCollector
 
210
    def initialize(logs)
 
211
      @logs = logs
 
212
    end
 
213
 
 
214
    def <<(value)
 
215
      @logs << value
 
216
    end
 
217
  end
 
218
end
 
219
 
208
220
Puppet::Util::Log.newdesttype :array do
209
 
  match "Array"
 
221
  match "Puppet::Test::LogCollector"
210
222
 
211
223
  def initialize(messages)
212
224
    @messages = messages