module Chatterbot::Logging

routines for outputting log messages, as well as logging tweets to the database if desired.

Public Instance Methods

critical(s) click to toggle source

something really bad happened, print it out and log it

# File lib/chatterbot/logging.rb, line 19
def critical(s)
  puts s
  debug s
end
debug(s) click to toggle source

log a message

# File lib/chatterbot/logging.rb, line 12
def debug(s)
  puts s if verbose?
  logger.debug "#{botname} #{s}" unless ! logging?
end

Protected Instance Methods

logger() click to toggle source

initialize a Logger object, writing to log_dest

# File lib/chatterbot/logging.rb, line 27
def logger
  # log to the dest specified in the config file, rollover after 10mb of data
  @_logger ||= Logger.new(log_dest, 0, 1024 * 1024)
end