Sha256: b3e2c9f2a2c1f3f75f186108a28491f7f5c0a44f516b4ce349c14d495e2f9774

Contents?: true

Size: 730 Bytes

Versions: 21

Compression:

Stored size: 730 Bytes

Contents

class Marty::Logger
  include Delorean::Model

  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

  delorean_fn :dllog, sig: [2, 20] do
     |*args|

     info args[0], args[1..-1]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
marty-2.5.2 lib/marty/logger.rb
marty-2.5.1 lib/marty/logger.rb
marty-2.5.0 lib/marty/logger.rb
marty-2.4.9 lib/marty/logger.rb
marty-2.4.8 lib/marty/logger.rb
marty-2.4.7 lib/marty/logger.rb
marty-2.4.6 lib/marty/logger.rb
marty-2.4.5 lib/marty/logger.rb
marty-2.4.4 lib/marty/logger.rb
marty-2.4.3 lib/marty/logger.rb
marty-2.4.2 lib/marty/logger.rb
marty-2.4.1 lib/marty/logger.rb
marty-2.4.0 lib/marty/logger.rb
marty-2.3.15 lib/marty/logger.rb
marty-2.3.14 lib/marty/logger.rb
marty-2.3.13 lib/marty/logger.rb
marty-2.3.12 lib/marty/logger.rb
marty-2.3.11 lib/marty/logger.rb
marty-2.3.10 lib/marty/logger.rb
marty-2.3.9 lib/marty/logger.rb