Module: Priam
- Defined in:
- lib/priam.rb
Defined Under Namespace
Class Method Summary collapse
- .default_logger ⇒ Object
- .get_column(client, column_family, super_column, key, options = {}) ⇒ Object
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .rails_logger ⇒ Object
Class Method Details
.default_logger ⇒ Object
24 25 26 27 28 29 |
# File 'lib/priam.rb', line 24 def self.default_logger require 'logger' l = Logger.new(STDERR) l.level = Logger::INFO l end |
.get_column(client, column_family, super_column, key, options = {}) ⇒ Object
5 6 7 |
# File 'lib/priam.rb', line 5 def self.get_column(client, column_family, super_column, key, ={}) return Priam::Core::Get.get_column(client, column_family, super_column, key, ) end |
.logger ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/priam.rb', line 9 def self.logger if @logger.nil? @logger = (rails_logger || default_logger) @logger.formatter = proc { |severity, datetime, progname, msg| datetime.strftime("[%Y-%m-%d %H:%M:%S](#{severity})#{msg}\n") } end return @logger end |
.logger=(logger) ⇒ Object
31 32 33 |
# File 'lib/priam.rb', line 31 def self.logger=(logger) @logger = logger end |
.rails_logger ⇒ Object
19 20 21 22 |
# File 'lib/priam.rb', line 19 def self.rails_logger (defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger) || (defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:debug) && RAILS_DEFAULT_LOGGER) end |