Class | DataMapper::Logger |
In: |
lib/dm-core/logger.rb
|
Parent: | Object |
LEVELS | = | { :off => 99999, :fatal => 7, :error => 6, :warn => 4, :info => 3, :debug => 0 |
@note
Ruby (standard) logger levels: off: absolutely nothing fatal: an unhandleable error that results in a program crash error: a handleable error condition warn: a warning info: generic (useful) information about system operation debug: low-level information for developers DataMapper::Logger::LEVELS[:off, :fatal, :error, :warn, :info, :debug] |
write_nonblock | -> | write_method |
write | -> | write_method |
push_opened | -> | internal_push |
push_closed | -> | internal_push |
aio | [RW] | |
buffer | [R] | |
delimiter | [RW] | |
level | [R] | |
log | [R] |
To initialize the logger you create a new object, proxies to set_log.
DataMapper::Logger.new(log{String, IO},level{Symbol, String})
@param log<IO,String> either an IO object or a name of a logfile. @param log_level<String> the message string to be logged @param delimiter<String> delimiter to use between message sections @param log_creation<Boolean> log that the file is being created
@note
Note that the string is discarded if the string's log level less than the logger's log level.
@note
Note that if the logger is aio capable then the logger will use non-blocking asynchronous writes.
@param level<Fixnum> the logging level as an integer @param string<String> the message string to be logged
To replace an existing logger with a new one:
DataMapper.logger.set_log(log{String, IO},level{Symbol, String})
@param log<IO,String> either an IO object or a name of a logfile. @param log_level<Symbol> a symbol representing the log level from
{:off, :fatal, :error, :warn, :info, :debug}
@param delimiter<String> delimiter to use between message sections @param log_creation<Boolean> log that the file is being created