Class | Needle::LogFactory |
In: |
lib/needle/log-factory.rb
|
Parent: | Object |
A factory class that returns Logger instances. Since each registry has its own logger factory, the logger factory must be separately instantiable.
DEFAULT_LOG_FILENAME | = | "./needle.log" | The default name of the log file to write to. | |
DEFAULT_MESSAGE_FORMAT | = | "[%-5p] %d -- %C: %m" | The default format of the log messages (see Logger for more info) | |
LEVEL_TRANSLATOR | = | { "DEBUG" => Logger::DEBUG, "INFO" => Logger::INFO, "WARN" => Logger::WARN, "ERROR" => Logger::ERROR, "FATAL" => Logger::FATAL, "UNKNOWN" => Logger::UNKNOWN | Translate names of levels to their actual values. | |
VALID_OPTIONS | = | [ :device, :filename, :roll_age, :roll_frequency, :roll_size, :default_date_format, :default_message_format, :default_level, :levels ] | ||
VALID_LEVEL_OPTIONS | = | [ :level, :date_format, :message_format ] |
default_date_format | [R] | The default date format string to use when logging. |
default_level | [R] | The default log level to use for logs that are created. |
default_message_format | [R] | The default message format string to use when logging. |
device | [R] | The device that logs will write to. |
Create a new LogFactory using the given initialization parameters. The valid options are:
Retrieves the logger with the given name. If no such log has been created, the log will be created and initialized. Otherwise, the log with the given name is returned.
If name responds to either fullname or name, then the result of invoking that message on name will be used as the name.