Sha256: dfdb8aebdc1295a7917d4b4a40f9454f94dcd54018856d7030772b94f366bd4e

Contents?: true

Size: 614 Bytes

Versions: 50

Compression:

Stored size: 614 Bytes

Contents

class Marty::Logger

  def self.method_missing(m, *args, &block)
    return super unless
      [:debug, :info, :warn, :error, :fatal, :unknown].include?(m)
    Marty::Util.logger.send(m, args[0]) if Marty::Util.logger.respond_to?(m)
    log(m, *args)
  end

  def self.log(type, message, details=nil)
    Marty::Log.write_log(type, message, details)
  end

  def self.with_logging(error_message, error_data)
    begin
      yield
    rescue => e
      error(error_message, { "message" => e.message,
                             "data" => error_data})
      raise "#{error_message}: #{e.message}"
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
marty-2.3.7 lib/marty/logger.rb
marty-2.3.5 lib/marty/logger.rb
marty-2.3.4 lib/marty/logger.rb
marty-2.1.5 lib/marty/logger.rb
marty-2.3.2 lib/marty/logger.rb
marty-2.3.1 lib/marty/logger.rb
marty-2.3.0 lib/marty/logger.rb
marty-2.1.4 lib/marty/logger.rb
marty-2.1.3 lib/marty/logger.rb
marty-2.1.2 lib/marty/logger.rb
marty-2.1.1 lib/marty/logger.rb
marty-2.1.0 lib/marty/logger.rb
marty-2.0.9 lib/marty/logger.rb
marty-2.0.8 lib/marty/logger.rb
marty-2.0.7 lib/marty/logger.rb
marty-2.0.6 lib/marty/logger.rb
marty-2.0.5 lib/marty/logger.rb
marty-2.0.4 lib/marty/logger.rb
marty-2.0.3 lib/marty/logger.rb
marty-2.0.2 lib/marty/logger.rb