Sha256: 80130b18a44762d57e5a4c378748b16975a97510e3c3017f7c719e2f0c835e1c

Contents?: true

Size: 717 Bytes

Versions: 96

Compression:

Stored size: 717 Bytes

Contents

# ********** Copyright Viacom, Inc. Apache 2.0 **********

module RokuBuilder
  class Logger

    @@instance = nil

    def self.instance
      unless @@instance
        @@instance = ::Logger.new(STDOUT)
        @@instance.formatter = proc {|severity, datetime, _progname, msg|
          "[%s #%s] %5s: %s\n\r" % [datetime.strftime("%Y-%m-%d %H:%M:%S.%4N"), $$, severity, msg]
        }
      end
      @@instance
    end

    def self.set_debug
      instance.level = ::Logger::DEBUG
    end
    def self.set_info
      instance.level = ::Logger::INFO
    end
    def self.set_warn
      instance.level = ::Logger::WARN
    end

    def self.set_testing
      @@instance = ::Logger.new(File::NULL)
    end
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
roku_builder-4.30.0 lib/roku_builder/logger.rb
roku_builder-4.29.9 lib/roku_builder/logger.rb
roku_builder-4.29.8 lib/roku_builder/logger.rb
roku_builder-4.29.7 lib/roku_builder/logger.rb
roku_builder-4.29.6 lib/roku_builder/logger.rb
roku_builder-4.29.4 lib/roku_builder/logger.rb
roku_builder-4.29.2 lib/roku_builder/logger.rb
roku_builder-4.29.1 lib/roku_builder/logger.rb
roku_builder-4.28.0 lib/roku_builder/logger.rb
roku_builder-4.27.2 lib/roku_builder/logger.rb
roku_builder-4.27.1 lib/roku_builder/logger.rb
roku_builder-4.27.0 lib/roku_builder/logger.rb
roku_builder-4.26.2 lib/roku_builder/logger.rb
roku_builder-4.26.1 lib/roku_builder/logger.rb
roku_builder-4.26.0 lib/roku_builder/logger.rb
roku_builder-4.25.6 lib/roku_builder/logger.rb
roku_builder-4.25.5 lib/roku_builder/logger.rb
roku_builder-4.25.4 lib/roku_builder/logger.rb
roku_builder-4.25.3 lib/roku_builder/logger.rb
roku_builder-4.25.1 lib/roku_builder/logger.rb