Sha256: a6732451da2b063aefa9b49352802e60987d55141ed92c33a8cf82ca37a836a0

Contents?: true

Size: 465 Bytes

Versions: 4

Compression:

Stored size: 465 Bytes

Contents

module Bunnish::Core
  module Common
    def self.output_log(streams, log_level, message)
      case log_level
      when "INFO"
        Bunnish.logger.info(message)
      when "EXCEPTION"
        Bunnish.logger.warn(message)
      end
      message =  Time.now.strftime("[%Y-%m-%d %H:%M:%S](#{log_level})#{message}")
      streams.each do |stream|
        if stream then
          stream.puts message
          stream.flush
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bunnish-0.0.7 lib/bunnish/core/common.rb
bunnish-0.0.6 lib/bunnish/core/common.rb
bunnish-0.0.5 lib/bunnish/core/common.rb
bunnish-0.0.4 lib/bunnish/core/common.rb