Class: Merb::BootLoader::Logger

Inherits:
Merb::BootLoader show all
Defined in:
lib/merb-core/bootloader.rb

Overview

Set up the logger.

Place the logger inside of the Merb log directory (set up in Merb::BootLoader::BuildFramework)

Class Method Summary collapse

Methods inherited from Merb::BootLoader

after, after_app_loads, before, before_app_loads, default_framework, finished?, inherited, move_klass

Class Method Details

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Print a warning if the installed version of rubygems is not supported

Returns

nil



206
207
208
209
210
211
# File 'lib/merb-core/bootloader.rb', line 206

def self.print_warnings
  if Gem::Version.new(Gem::RubyGemsVersion) < Gem::Version.new("1.1")
    Merb.fatal! "Merb requires Rubygems 1.1 and later. " \
      "Please upgrade RubyGems with gem update --system."
  end
end

.runObject

Sets Merb.logger to a new logger created based on the config settings.

Returns

nil



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/merb-core/bootloader.rb', line 184

def self.run
  Merb::Config[:log_level] ||= begin
    if Merb.environment == "production"
      Merb::Logger::Levels[:warn]
    else
      Merb::Logger::Levels[:debug]
    end
  end

  Merb::Config[:log_stream] = Merb.log_stream

  print_warnings
  
  nil
end