Sha256: 16f2613676c7b3d8261cb2d357637f64e1db706127944d56e2926919d4467729

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

require './log/log_entry'

class Log
  def initialize(site)
    @site = site
  end
  
  def debug(message)
    build_log_entry(LogEntry::DEBUG, message)
  end
  
  def info(message)
    build_log_entry(LogEntry::INFO, message)
  end
  
  def warn(message)
    build_log_entry(LogEntry::WARN, message)
  end
  
  def error(message)
    build_log_entry(LogEntry::ERROR, message)
  end
  
  def fatal(message)
    build_log_entry(LogEntry::FATAL, message)
  end
  
  private
    def build_log_entry(severity, message)
      entry = LogEntry.new(@site)
      entry.update(severity: severity, message: message)
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/models/core/log/log.rb
yodel-0.0.4 lib/yodel/models/core/log/log.rb
yodel-0.0.3 lib/yodel/models/core/log/log.rb
yodel-0.0.2 lib/yodel/models/core/log/log.rb
yodel-0.0.1 lib/yodel/models/core/log/log.rb