Sha256: fb738eecf4c64d2e591b10077164aea886c039233019b564d24edf557c646aa2

Contents?: true

Size: 694 Bytes

Versions: 12

Compression:

Stored size: 694 Bytes

Contents

module Railsthemes
  module Logging
    # Method to mix into classes
    def logger
      Logging.logger
    end

    def self.logger
      unless @logger
        @logger = Logger.new(STDOUT)
        @logger.level = Logger::WARN

        # just print out basic information, not all of the extra logger stuff
        @logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" }
      end
      @logger
    end

    def self.logger= logger
      @logger = logger
    end

    def self.verbose
      logger.level = Logger::INFO
      logger.info 'In verbose mode.'
    end

    def self.debug
      logger.level = Logger::DEBUG
      logger.debug 'In debug mode.'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
railsthemes-2.1.3 lib/railsthemes/logging.rb
railsthemes-2.1.2 lib/railsthemes/logging.rb
railsthemes-2.1.1 lib/railsthemes/logging.rb
railsthemes-2.1.0 lib/railsthemes/logging.rb
railsthemes-2.0.3 lib/railsthemes/logging.rb
railsthemes-2.0.2 lib/railsthemes/logging.rb
railsthemes-2.0.1 lib/railsthemes/logging.rb
railsthemes-2.0.0 lib/railsthemes/logging.rb
railsthemes-2.0.0.pre.2 lib/railsthemes/logging.rb
railsthemes-2.0.0.pre lib/railsthemes/logging.rb
railsthemes-1.2.0 lib/railsthemes/logging.rb
railsthemes-1.1.2 lib/railsthemes/logging.rb