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.21.2 lib/roku_builder/logger.rb
roku_builder-4.21.1 lib/roku_builder/logger.rb
roku_builder-4.21.0 lib/roku_builder/logger.rb
roku_builder-4.20.0 lib/roku_builder/logger.rb
roku_builder-4.19.0 lib/roku_builder/logger.rb
roku_builder-4.18.0 lib/roku_builder/logger.rb
roku_builder-4.17.1 lib/roku_builder/logger.rb
roku_builder-4.17.0 lib/roku_builder/logger.rb
roku_builder-4.16.1 lib/roku_builder/logger.rb
roku_builder-4.15.2 lib/roku_builder/logger.rb
roku_builder-4.15.1 lib/roku_builder/logger.rb
roku_builder-4.15.0 lib/roku_builder/logger.rb
roku_builder-4.14.1 lib/roku_builder/logger.rb
roku_builder-4.14.0 lib/roku_builder/logger.rb
roku_builder-4.12.3 lib/roku_builder/logger.rb
roku_builder-4.13.0 lib/roku_builder/logger.rb
roku_builder-4.12.2 lib/roku_builder/logger.rb
roku_builder-4.12.1 lib/roku_builder/logger.rb
roku_builder-4.12.0 lib/roku_builder/logger.rb
roku_builder-4.11.5 lib/roku_builder/logger.rb