Sha256: 37d63a086dbb05240c92be46e1fbc004b7ef011fa144927ba270bb3ffccd8d45

Contents?: true

Size: 660 Bytes

Versions: 7

Compression:

Stored size: 660 Bytes

Contents

require 'logger'

module Chatterbot

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

    #
    # log a message
    def debug(s)
      puts s if verbose?
      logger.debug "#{botname} #{s}" unless ! logging?
    end

    #
    # something really bad happened, print it out and log it
    def critical(s)
      puts s
      debug s
    end
    
protected
    #
    # initialize a Logger object, writing to log_dest
    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

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chatterbot-2.2.0 lib/chatterbot/logging.rb
chatterbot-2.1.0 lib/chatterbot/logging.rb
chatterbot-2.0.5 lib/chatterbot/logging.rb
chatterbot-2.0.4 lib/chatterbot/logging.rb
chatterbot-2.0.3 lib/chatterbot/logging.rb
chatterbot-2.0.2 lib/chatterbot/logging.rb
chatterbot-2.0.0.pre lib/chatterbot/logging.rb