Sha256: 5b65c28617d169a96b864e288bcb9700f312f6e301511cdde0d02f82f2ceedfd

Contents?: true

Size: 489 Bytes

Versions: 9

Compression:

Stored size: 489 Bytes

Contents

module UniformNotifier
  class CustomizedLogger < Base
    @logger = nil

    def self.active?
      @logger
    end

    def self.out_of_channel_notify( message )
      return unless active?
      @logger.warn message
    end

    def self.setup(logdev)
      require 'logger'

      @logger = Logger.new( logdev )

      def @logger.format_message( severity, timestamp, progname, msg )
        "#{timestamp.strftime("%Y-%m-%d %H:%M:%S")}[#{severity}] #{msg}"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
uniform_notifier-1.5.0 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.4.0 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.3.0 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.2.0 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.1.1 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.1.0 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.0.2 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.0.1 lib/uniform_notifier/customized_logger.rb
uniform_notifier-1.0.0 lib/uniform_notifier/customized_logger.rb