]>
git.r.bdr.sh - rbdr/cologne/blob - lib/cobalt.rb
ce42a5de31f620000c3e42efa732251742742b73
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
)
47 color(:cyan) { log(*objects
) }
51 color(:yellow) { log(*objects
) }
55 color(:red) { log(*objects
) }
58 def separator(type
= '-')
59 log((type
* (@separator_length - @indent)))
63 lines
.times
{ self.log('') }