Sha256: 0bf952ec258eed9e706aafc4855d68c75dbbcf86578f3c5cb565f64905e29905

Contents?: true

Size: 699 Bytes

Versions: 14

Compression:

Stored size: 699 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

14 entries across 14 versions & 1 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/logging.rb
brightbox-cli-0.18.0 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.5 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.4 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.3 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.2 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.1 lib/brightbox-cli/logging.rb
brightbox-cli-0.17.0 lib/brightbox-cli/logging.rb
brightbox-cli-0.16.0 lib/brightbox-cli/logging.rb
brightbox-cli-0.15.0 lib/brightbox-cli/logging.rb
brightbox-cli-0.14.1 lib/brightbox-cli/logging.rb
brightbox-cli-0.14.0 lib/brightbox-cli/logging.rb
brightbox-cli-0.13.1 lib/brightbox-cli/logging.rb
brightbox-cli-0.13.0 lib/brightbox-cli/logging.rb