]>
git.r.bdr.sh - rbdr/cologne/blob - lib/cobalt.rb
bcd683c020b7c91eb16601e9584ca85945113b73
9 attr_accessor
:separator_length
11 def initialize( options
= {} )
13 @loggers = options
[:loggers] || [::Logger.new(STDOUT)]
14 @separator_length = 120
22 def remove_logger logger
23 @loggers = @loggers - [logger
]
27 objects
.each
do |object
|
28 the_string
= object
.to_s
29 the_string
= the_string
.to_ansi
.send(@color).to_s
30 the_string
= the_string
.gsub(/^/, ' ' * @indent)
31 @loggers.each
{ |logger
| logger
.info(the_string
) }
41 PP
.pp(objects
.first
, dump
)
51 color(:cyan) { log(*objects
) }
55 color(:yellow) { log(*objects
) }
59 color(:red) { log(*objects
) }
62 def separator(type
= '-')
63 log((type
* (@separator_length - @indent)))
67 lines
.times
{ self.log('') }