module TTWatcher::Logger

Attributes

level[RW]

@return [Symbol] (:normal)

Verbose level, possible values :development, :standard, :disabled:

Public Class Methods

extended(mod) click to toggle source
# File sources/ttwatcher/logger.rb, line 5
def self.extended(mod)
  @level = :standard
end

Public Instance Methods

<<(*args) click to toggle source
# File sources/ttwatcher/logger.rb, line 36
def <<(*args)
  Array(args).each { |arg| logger.puts arg}
end
logger() click to toggle source
# File sources/ttwatcher/logger.rb, line 28
def logger
  @logger || $stdout
end
logger=(new_logger) click to toggle source
# File sources/ttwatcher/logger.rb, line 32
def logger=(new_logger)
  @logger = new_logger
end
with_backtrace(msg) click to toggle source

Prints customized message with backtrace to last exception.

@param [String] msg

# File sources/ttwatcher/logger.rb, line 20
def with_backtrace(msg)
  puts "\n", msg

  puts "\n", "**** Backtrace ****".center(100), "\n"
  puts $@.join("\n"), "\n"
  puts "**** End ****".center 100
end