class Backup::Logger::Message
All messages sent to the Logger
are stored in Logger.messages
and sent to all enabled logger’s log method as Message
objects.
Public Instance Methods
formatted_lines()
click to toggle source
Returns an Array of the message lines in the following format:
[YYYY/MM/DD HH:MM:SS][level] message line text
# File lib/backup/logger.rb, line 45 def formatted_lines timestamp = time.strftime("%Y/%m/%d %H:%M:%S") lines.map {|line| "[#{ timestamp }][#{ level }] #{ line }" } end
matches?(ignores)
click to toggle source
# File lib/backup/logger.rb, line 50 def matches?(ignores) text = lines.join("\n") ignores.any? {|obj| obj.is_a?(Regexp) ? text.match(obj) : text.include?(obj) } end