Sha256: 039bf81d772bff3d49b38d3a7945adaed1b7f9ca0124239f807b107c19dfc5b1

Contents?: true

Size: 550 Bytes

Versions: 2

Compression:

Stored size: 550 Bytes

Contents

module Rpush
  module Daemon
    module Loggable
      def log_info(msg)
        Rpush.logger.info(app_prefix(msg))
      end

      def log_warn(msg)
        Rpush.logger.warn(app_prefix(msg))
      end

      def log_error(e)
        if e.is_a?(Exception)
          Rpush.logger.error(e)
        else
          Rpush.logger.error(app_prefix(e))
        end
      end

      private

      def app_prefix(msg)
        if app = instance_variable_get('@app')
          msg = "[#{app.name}] #{msg}"
        end

        msg
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rpush-1.0.0-java lib/rpush/daemon/loggable.rb
rpush-1.0.0 lib/rpush/daemon/loggable.rb