lib/rsmp/logger.rb in rsmp-0.1.19 vs lib/rsmp/logger.rb in rsmp-0.1.21
- old
+ new
@@ -80,11 +80,10 @@
@stream.puts str
@stream.flush
end
def colorize level, str
- #p String.color_samples
if @settings["color"] == false || @settings["color"] == nil
str
elsif @settings["color"] == true
case level
when :error
@@ -123,11 +122,12 @@
else
' '*length
end
end
- def dump archive, force:false
- log = archive.items.map do |item|
+ def dump archive, force:false, num:nil
+ num ||= archive.items.size
+ log = archive.items.last(num).map do |item|
str = build_output item
str = colorize item[:level], str
end
log.join("\n")
end
\ No newline at end of file