Class | Merb::Logger
In: | lib/merb-core/logger.rb
Parent: | Extlib::Logger

Merb::Logger = Extlib::Logger

### Methods

<< close flush new push set_log verbose verbose!

### Constants

Levels

=

Mash.new({ :fatal => 7, :error => 6, :warn => 4, :info => 3, :debug => 0

#### Notes

Ruby (standard) logger levels:

: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

### Attributes

auto_flush | [RW] |
buffer | [R] |
delimiter | [RW] |
init_args | [R] |
level | [RW] |
log | [R] |

### Public Class methods

new(*args)

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

#### Parameters

*args: | Arguments to create the log from. See set_logs for specifics.

### Public Instance methods

<<(string = nil)

Appends a message to the log. The methods yield to an optional block and the output of this block will be appended to the message.

#### Parameters

string<String>: | The message to be logged. Defaults to nil.

#### Returns

String: | The resulting message added to the log file.

close()

Close and remove the current log object.

flush()

Flush the entire buffer to the log object.

push(string = nil)

Alias for #<<

set_log(stream = Merb::Config[:log_stream], log_level = Merb::Config[:log_level], delimiter = Merb::Config[:log_delimiter], auto_flush = Merb::Config[:log_auto_flush])

Replaces an existing logger with a new one.

#### Parameters

stream<IO, String>: | Either an IO object or a name of a logfile.
log_level<~to_sym>: | The log level from, e.g. :fatal or :info. Defaults to :error in the production environment and :debug otherwise.
delimiter<String>: | Delimiter to use between message sections. Defaults to " ~ ".
auto_flush<Boolean>: | Whether the log should automatically flush after new messages are added. Defaults to false.

verbose(message, level = :warn)

:api: public

verbose!(message, level = :warn)

:api: public

[Validate]