Sha256: 1defff58a6e24752272a2ade84b424c9c41497b36b974990ec30d7f9488265ba

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

require 'logger'

module RosettaQueue
  class MissingLogger < ::StandardError; end

  def self.logger=(new_logger)
    @logger = new_logger
  end
  
  def self.logger
    return @logger if @logger
    raise MissingLogger, "No logger has been set for RosettaQueue.  Please define one with RosettaQueue.logger=."
  end

end

module RosettaQueue

  class Logger < ::Logger

    def format_message(severity, timestamp, progname, msg)
      "[#{timestamp.to_formatted_s(:db)}] #{severity} -- : #{msg}\n"
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cwyckoff-rosetta_queue-0.3.3 lib/rosetta_queue/logger.rb