Module: SimpleLogger

Defined in:
lib/simple-logger/plain.rb,
lib/simple-logger/logger.rb

Overview

Public SimpleLogger Logger API

To replace an existing logger with a new one:

SimpleLogger::Plain.set_log(log{String, IO},level{Symbol, String})

Available logging levels are

SimpleLogger::Plain::{ Fatal, Error, Warn, Info, Debug }

Logging via:

SimpleLogger.logger.fatal(message<String>,&block)
SimpleLogger.logger.error(message<String>,&block)
SimpleLogger.logger.warn(message<String>,&block)
SimpleLogger.logger.info(message<String>,&block)
SimpleLogger.logger.debug(message<String>,&block)

Logging with autoflush:

SimpleLogger.logger.fatal!(message<String>,&block)
SimpleLogger.logger.error!(message<String>,&block)
SimpleLogger.logger.warn!(message<String>,&block)
SimpleLogger.logger.info!(message<String>,&block)
SimpleLogger.logger.debug!(message<String>,&block)

Flush the buffer to

SimpleLogger.logger.flush

Remove the current log object

SimpleLogger.logger.close

Private SimpleLogger Logger API

To initialize the logger you create a new object, proxies to set_log.

SimpleLogger::Plain.new(log{String, IO},level{Symbol, String})

Defined Under Namespace

Classes: Logger, Plain

Class Attribute Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



40
41
42
# File 'lib/simple-logger/plain.rb', line 40

def logger
  @logger
end