Sha256: 1e489cf3b2fdc88625e6e1a141ab38e394e0d43f7508b585a45775c05bf28d82

Contents?: true

Size: 619 Bytes

Versions: 37

Compression:

Stored size: 619 Bytes

Contents

module Rpush
  module Daemon
    module Loggable
      def log_debug(msg)
        Rpush.logger.debug(app_prefix(msg))
      end

      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)
        app = instance_variable_get('@app')
        msg = "[#{app.name}] #{msg}" if app
        msg
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
rpush-9.1.0 lib/rpush/daemon/loggable.rb
rpush-9.0.0 lib/rpush/daemon/loggable.rb
rpush-8.0.0 lib/rpush/daemon/loggable.rb
rpush-7.0.1 lib/rpush/daemon/loggable.rb
rpush-7.0.0 lib/rpush/daemon/loggable.rb
rpush-6.0.1 lib/rpush/daemon/loggable.rb
rpush-6.0.0 lib/rpush/daemon/loggable.rb
rpush-5.4.0 lib/rpush/daemon/loggable.rb
rpush-5.3.0 lib/rpush/daemon/loggable.rb
rpush-5.2.0 lib/rpush/daemon/loggable.rb
rpush-5.1.0 lib/rpush/daemon/loggable.rb
rpush-5.0.0 lib/rpush/daemon/loggable.rb
rpush-4.2.0 lib/rpush/daemon/loggable.rb
rpush-4.1.1 lib/rpush/daemon/loggable.rb
rpush-4.1.0 lib/rpush/daemon/loggable.rb
rpush-4.0.1 lib/rpush/daemon/loggable.rb
rpush-4.0.0 lib/rpush/daemon/loggable.rb
rpush-3.3.1 lib/rpush/daemon/loggable.rb
rpush-3.3.0 lib/rpush/daemon/loggable.rb
rpush_extended-3.2.6 lib/rpush/daemon/loggable.rb