module TFClient

Constants

VERSION

Public Class Methods

debug(msg) click to toggle source

magenta

# File lib/textflight-client/logging.rb, line 17
def self.debug(msg)
  if ENV["DEBUG"] == "1"
    puts Color.magenta("DEBUG: #{msg}") if msg
  end
end
deprecated(version, msg) click to toggle source

Prints a deprecated message that includes the line number.

@param [String] version Indicates when the feature was deprecated. @param [String] msg Deprecation message (possibly suggesting alternatives) @return [void]

# File lib/textflight-client.rb, line 23
def self.deprecated(version, msg)

  stack = Kernel.caller(0, 6)[1..-1].join("\n")

  msg = "deprecated '#{version}' - #{msg}\n#{stack}"

  $stderr.puts "\033[34mWARN: #{msg}\033[0m"
  $stderr.flush
end
error(msg) click to toggle source

red

# File lib/textflight-client/logging.rb, line 29
def self.error(msg)
  puts Color.red("ERROR: #{msg}") if msg
end
info(msg) click to toggle source

green

# File lib/textflight-client/logging.rb, line 24
def self.info(msg)
  puts Color.green(" INFO: #{msg}") if msg
end
log_unix_cmd(msg) click to toggle source

cyan

# File lib/textflight-client/logging.rb, line 5
def self.log_unix_cmd(msg)
  if ENV["DEBUG"] == "1"
    puts Color.cyan("SHELL: #{msg}") if msg
  end
end
warn(msg) click to toggle source

blue

# File lib/textflight-client/logging.rb, line 12
def self.warn(msg)
  puts Color.blue(" WARN: #{msg}") if msg
end