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.25.0 lib/roku_builder/logger.rb
roku_builder-4.24.3 lib/roku_builder/logger.rb
roku_builder-4.24.1 lib/roku_builder/logger.rb
roku_builder-4.24.0 lib/roku_builder/logger.rb
roku_builder-4.23.2 lib/roku_builder/logger.rb
roku_builder-4.23.1 lib/roku_builder/logger.rb
roku_builder-4.23.0 lib/roku_builder/logger.rb
roku_builder-4.22.9 lib/roku_builder/logger.rb
roku_builder-4.22.8 lib/roku_builder/logger.rb
roku_builder-4.22.7 lib/roku_builder/logger.rb
roku_builder-4.22.6 lib/roku_builder/logger.rb
roku_builder-4.22.5 lib/roku_builder/logger.rb
roku_builder-4.22.4 lib/roku_builder/logger.rb
roku_builder-4.22.3 lib/roku_builder/logger.rb
roku_builder-4.22.2 lib/roku_builder/logger.rb
roku_builder-4.22.1 lib/roku_builder/logger.rb
roku_builder-4.21.6 lib/roku_builder/logger.rb
roku_builder-4.21.5 lib/roku_builder/logger.rb
roku_builder-4.21.4 lib/roku_builder/logger.rb
roku_builder-4.21.3 lib/roku_builder/logger.rb