Sha256: beb520758a28f09e40aa3cea6d7e956a234444f2b9640c0e7ac8ccf552dd0433

Contents?: true

Size: 711 Bytes

Versions: 43

Compression:

Stored size: 711 Bytes

Contents

module Brightbox
  module Logging
    def self.included(base)
      base.extend MixinMethods
      base.send(:include, MixinMethods)
    end

    module MixinMethods
      def error(s = "")
        $stderr.write s
        $stderr.write "\n"
        $stderr.flush
      end

      def info(s = "")
        $stderr.write s
        $stderr.write "\n"
        $stderr.flush
      end

      def warn(s = "")
        info "WARN: #{s}"
      end

      def data(s)
        $stdout.write s
        $stdout.write "\n"
      end

      def debug(s)
        if ENV['DEBUG']
          $stderr.write "DEBUG: "
          $stderr.write s
          $stderr.write "\n"
        end
      end
    end
  end
  include Logging
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 lib/brightbox-cli/logging.rb
brightbox-cli-3.2.0 lib/brightbox-cli/logging.rb
brightbox-cli-3.1.0 lib/brightbox-cli/logging.rb
brightbox-cli-3.0.1 lib/brightbox-cli/logging.rb
brightbox-cli-3.0.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.12.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.11.2 lib/brightbox-cli/logging.rb
brightbox-cli-2.11.1 lib/brightbox-cli/logging.rb
brightbox-cli-2.11.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.10.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.9.3 lib/brightbox-cli/logging.rb
brightbox-cli-2.9.2 lib/brightbox-cli/logging.rb
brightbox-cli-2.9.1 lib/brightbox-cli/logging.rb
brightbox-cli-2.9.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.8.2 lib/brightbox-cli/logging.rb
brightbox-cli-2.8.1 lib/brightbox-cli/logging.rb
brightbox-cli-2.8.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.7.1 lib/brightbox-cli/logging.rb
brightbox-cli-2.7.0 lib/brightbox-cli/logging.rb
brightbox-cli-2.6.0 lib/brightbox-cli/logging.rb