Module: Ledis

Defined in:
lib/ledis.rb

Defined Under Namespace

Classes: Logger

Class Method Summary collapse

Class Method Details

.dependenciesObject



74
75
76
77
78
79
# File 'lib/ledis.rb', line 74

def dependencies
  {
    'map'             => [ 'map'           , ' >= 6.0.1' ],
    'redis'           => [ 'redis'         , ' >= 2.2.2' ]
  }
end

.descriptionObject



70
71
72
# File 'lib/ledis.rb', line 70

def description
  'a K.I.S.S auto-rotating redis logger for ruby/rails'
end

.logger(*args, &block) ⇒ Object



96
97
98
99
100
# File 'lib/ledis.rb', line 96

def logger(*args, &block)
  return rails_logger(*args, &block) if defined?(::Rails.application)

  Logger.new(*args, &block)
end

.rails_logger(*args, &block) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/ledis.rb', line 102

def rails_logger(*args, &block)
  config = ::Rails.application.config

  logger = Logger.new(*args, &block)

  if defined?(::ActiveSupport::TaggedLogging)
    logger = ::ActiveSupport::TaggedLogging.new(logger)
  end

  logger.level = config.log_level

  logger
end

.versionObject



66
67
68
# File 'lib/ledis.rb', line 66

def version
  '0.0.3'
end