vendor/gems/logging-0.9.7/lib/logging.rb
def init( *args )
      args = %w(debug info warn error fatal) if args.empty?

      args.flatten!
      levels = ::Logging::LEVELS.clear
      names = ::Logging::LNAMES.clear

      id = 0
      args.each do |lvl|
        lvl = levelify lvl
        unless levels.has_key?(lvl) or lvl == 'all' or lvl == 'off'
          levels[lvl] = id 
          names[id] = lvl.upcase
          id += 1
        end
      end

      longest = names.inject {|x,y| (x.length > y.length) ? x : y}
      longest = 'off' if longest.length < 3
      module_eval "MAX_LEVEL_LENGTH = #{longest.length}", __FILE__, __LINE__

      levels.keys
    end
# call-seq:
#    Logging.init( levels )
#
# Defines the levels available to the loggers. The _levels_ is an array
# of strings and symbols. Each element in the array is downcased and
# converted to a symbol; these symbols are used to create the logging
# methods in the loggers.
#
# The first element in the array is the lowest logging level. Setting the
# logging level to this value will enable all log messages. The last
# element in the array is the highest logging level. Setting the logging
# level to this value will disable all log messages except this highest
# level.
#
# This method should only be invoked once to configure the logging
# levels. It is automatically invoked with the default logging levels
# when the first logger is created.
#
# The levels "all" and "off" are reserved and will be ignored if passed
# to this method.
#
# Example:
#
#    Logging.init :debug, :info, :warn, :error, :fatal
#    log = Logging::Logger['my logger']
#    log.level = :warn
#    log.warn 'Danger! Danger! Will Robinson'
#    log.info 'Just FYI'                        # => not logged
#
# or
#
#    Logging.init %w(DEBUG INFO NOTICE WARNING ERR CRIT ALERT EMERG)
#    log = Logging::Logger['syslog']
#    log.level = :notice
#    log.warning 'This is your first warning'
#    log.info 'Just FYI'                        # => not logged
#


Defines the levels available to the loggers. The _levels_ is an array
of strings and symbols. Each element in the array is downcased and
converted to a symbol; these symbols are used to create the logging
methods in the loggers.

The first element in the array is the lowest logging level. Setting the
logging level to this value will enable all log messages. The last
element in the array is the highest logging level. Setting the logging
level to this value will disable all log messages except this highest
level.

This method should only be invoked once to configure the logging
levels. It is automatically invoked with the default logging levels
when the first logger is created.

The levels "all" and "off" are reserved and will be ignored if passed
to this method.





or


Defines the levels available to the loggers . The _levels_ is an array of strings and symbols . Each element in the array is downcased and converted to a symbol ; these symbols are used to create the logging methods in the loggers . The first element in the array is the lowest logging level . Setting the logging level to this value will enable all log messages . The last element in the array is the highest logging level . Setting the logging level to this value will disable all log messages except this highest level . This method should only be invoked once to configure the logging levels . It is automatically invoked with the default logging levels when the first logger is created . The levels " all " and " off " are reserved and will be ignored if passed to this method . or
def init( *args )
      args = %w(debug info warn error fatal) if args.empty?
      args.flatten!
      levels = ::Logging::LEVELS.clear
      names = ::Logging::LNAMES.clear
      id = 0
      args.each do |lvl|
        lvl = levelify lvl
        unless levels.has_key?(lvl) or lvl == 'all' or lvl == 'off'
          levels[lvl] = id 
          names[id] = lvl.upcase
          id += 1
        end
      end
      longest = names.inject {|x,y| (x.length > y.length) ? x : y}
      longest = 'off' if longest.length < 3
      module_eval "MAX_LEVEL_LENGTH = #{longest.length}", __FILE__, __LINE__
      levels.keys
    end
def init ( * args ) args = %w( debug info warn error fatal ) if args . empty? args . flatten! levels = :: Logging :: LEVELS . clear names = :: Logging :: LNAMES . clear id = 0 args . each do | lvl | lvl = levelify lvl unless levels . has_key? ( lvl ) or lvl == 'all' or lvl == 'off' levels [ lvl ] = id names [ id ] = lvl . upcase id += 1 end end longest = names . inject { | x , y | ( x . length > y . length ) ? x : y } longest = 'off' if longest . length < 3 module_eval "MAX_LEVEL_LENGTH = #{longest.length}" , __FILE__ , __LINE__ levels . keys end
call-seq:
Logging.init( levels )
call - seq : Logging . init ( levels )
args