Sha256: cbb32b98e9d0458acdc7e72ee7a7343cf4c01c46c234eddf61a1332d7ab30af2

Contents?: true

Size: 752 Bytes

Versions: 19

Compression:

Stored size: 752 Bytes

Contents

module FaaStRuby
  module Local
    STDOUT_MUTEX = Mutex.new
    module Logger
      def self.puts(msg)
        STDOUT_MUTEX.synchronize do
          STDOUT.puts "#{Time.now} | #{msg}".yellow
          STDOUT.puts "---".yellow
        end
      end

      def debug(msg)
        return false unless DEBUG
        name = self.name if ['Module', 'Class'].include? self.class.name
        name ||= self.class.name
        STDOUT_MUTEX.synchronize do
          STDOUT.puts "#{Time.now} | [DEBUG] [#{name}] #{msg}".red
          STDOUT.puts "---".red
        end
      end

      def puts(msg)
        STDOUT_MUTEX.synchronize do
          STDOUT.puts "#{Time.now} | #{msg}".yellow
          STDOUT.puts "---".yellow
        end
      end

    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
faastruby-0.5.30 lib/faastruby/local/logger.rb
faastruby-0.5.29 lib/faastruby/local/logger.rb
faastruby-0.5.28 lib/faastruby/local/logger.rb
faastruby-0.5.27 lib/faastruby/local/logger.rb
faastruby-0.5.26 lib/faastruby/local/logger.rb
faastruby-0.5.25 lib/faastruby/local/logger.rb
faastruby-0.5.24 lib/faastruby/local/logger.rb
faastruby-0.5.23 lib/faastruby/local/logger.rb
faastruby-0.5.22 lib/faastruby/local/logger.rb
faastruby-0.5.21 lib/faastruby/local/logger.rb
faastruby-0.5.20 lib/faastruby/local/logger.rb
faastruby-0.5.19 lib/faastruby/local/logger.rb
faastruby-0.5.18 lib/faastruby/local/logger.rb
faastruby-0.5.17 lib/faastruby/local/logger.rb
faastruby-0.5.16 lib/faastruby/local/logger.rb
faastruby-0.5.15 lib/faastruby/local/logger.rb
faastruby-0.5.14 lib/faastruby/local/logger.rb
faastruby-0.5.13 lib/faastruby/local/logger.rb
faastruby-0.5.12 lib/faastruby/local/logger.rb