Module Mixlib::Log
In: lib/mixlib/log/version.rb
lib/mixlib/log/formatter.rb
lib/mixlib/log.rb

Methods

<<   add   init   level   level=   log   logger   logger=   loggers   method_missing   reset!   use_log_devices  

Classes and Modules

Class Mixlib::Log::Formatter

Constants

VERSION = "1.4.1"
LEVELS = { :debug=>Logger::DEBUG, :info=>Logger::INFO, :warn=>Logger::WARN, :error=>Logger::ERROR, :fatal=>Logger::FATAL}.freeze
LEVEL_NAMES = LEVELS.invert.freeze

Public Instance methods

Use Mixlib::Log.init when you want to set up the logger manually. Arguments to this method get passed directly to Logger.new, so check out the documentation for the standard Logger class to understand what to do here.

If this method is called with no arguments, it will log to STDOUT at the :warn level.

It also configures the Logger instance it creates to use the custom Mixlib::Log::Formatter class.

Sets the level for the Logger object by symbol. Valid arguments are:

 :debug
 :info
 :warn
 :error
 :fatal

Throws an ArgumentError if you feed it a bogus log level.

log(severity, message = nil, progname = nil, &block)

Alias for add

init always returns a configured logger and creates a new one if it doesn‘t yet exist

Sets the log device to new_log_device. Any additional loggers that had been added to the loggers array will be cleared.

An Array of log devices that will be logged to. Defaults to just the default @logger log device, but you can push to this array to add more devices.

Passes any other method calls on directly to the underlying Logger object created with init. If this method gets hit before a call to Mixlib::Logger.init has been made, it will call Mixlib::Logger.init() with no arguments.

[Validate]