Class: FeedUpdaterLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/feed_updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prefixObject

Returns the value of attribute prefix.



86
87
88
# File 'lib/feed_updater.rb', line 86

def prefix
  @prefix
end

Instance Method Details

#debug(message) ⇒ Object



97
98
99
# File 'lib/feed_updater.rb', line 97

def debug(message)
  self.log(0, message)
end

#error(message) ⇒ Object



109
110
111
# File 'lib/feed_updater.rb', line 109

def error(message)
  self.log(3, message)
end

#fatal(message) ⇒ Object



113
114
115
# File 'lib/feed_updater.rb', line 113

def fatal(message)
  self.log(4, message)
end

#info(message) ⇒ Object



101
102
103
# File 'lib/feed_updater.rb', line 101

def info(message)
  self.log(1, message)
end

#log(level, message) ⇒ Object



89
90
91
92
93
94
95
# File 'lib/feed_updater.rb', line 89

def log(level, message)
  if defined?(@prefix) && @prefix != nil
    self.old_log(level, "#{self.prefix}#{message}")
  else
    self.old_log(level, message)
  end
end

#old_logObject



88
# File 'lib/feed_updater.rb', line 88

alias_method :old_log, :log

#warn(message) ⇒ Object



105
106
107
# File 'lib/feed_updater.rb', line 105

def warn(message)
  self.log(2, message)
end