Sha256: 962a2a3130969cead2000080fe6fd74727569d615e048694082a2a611a75a3a9

Contents?: true

Size: 891 Bytes

Versions: 2

Compression:

Stored size: 891 Bytes

Contents

module Splash
  module Loggers

    class Dual #< Splash::Loggers::LoggerTemplate


      include Splash::Config


      LEVELS.each do |method|
        define_method(method) do |message,session = ''|
            self.log({ :level => method, :message => message, :session => session})
        end
      end
      ALIAS.keys.each do |method|
        define_method(method) do |message,session = ''|
            self.log({ :level => method, :message => message, :session => session})
        end
      end

      def initialize
        super
        @log1 = Splash::Loggers::Cli::new
        @log2 = Splash::Loggers::Daemon::new
      end

      def log(options)
        @log1.log options
        @log2.log options
      end
      def level
        @level
      end

      def level=(level)
        @level = level
        @log1.level=level
        @log2.level=level
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prometheus-splash-0.5.3 lib/splash/loggers/dual.rb
prometheus-splash-0.5.2 lib/splash/loggers/dual.rb