Class: EasyProfiler::FirebugLogger
- Inherits:
-
Object
- Object
- EasyProfiler::FirebugLogger
- Defined in:
- lib/easy_prof/firebug_logger.rb
Overview
A logger used to output logs to the Firebug console.
Instance Attribute Summary collapse
-
#logs ⇒ Object
Returns the value of attribute logs.
Instance Method Summary collapse
-
#clear ⇒ Object
Clear the logs.
-
#info(message = nil) ⇒ Object
Adds a line to the log.
-
#initialize ⇒ FirebugLogger
constructor
:nodoc:.
Constructor Details
#initialize ⇒ FirebugLogger
:nodoc:
8 9 10 |
# File 'lib/easy_prof/firebug_logger.rb', line 8 def initialize #:nodoc: @logs = [] end |
Instance Attribute Details
#logs ⇒ Object
Returns the value of attribute logs.
6 7 8 |
# File 'lib/easy_prof/firebug_logger.rb', line 6 def logs @logs end |
Instance Method Details
#clear ⇒ Object
Clear the logs.
13 14 15 |
# File 'lib/easy_prof/firebug_logger.rb', line 13 def clear @logs = [] end |
#info(message = nil) ⇒ Object
Adds a line to the log.
arguments
-
message– log message to be logged -
block– optional. Return value of the block will be the message that will be logged.
22 23 24 25 |
# File 'lib/easy_prof/firebug_logger.rb', line 22 def info( = nil) = yield if .nil? && block_given? @logs << end |