Class: Log4r::LogEvent
- Inherits:
-
Object
- Object
- Log4r::LogEvent
- Defined in:
- lib/log4r-color/logevent.rb
Overview
LogEvent wraps up all the miscellaneous data associated with a logging statement. It gets passed around to the varied components of Log4r and should be of interest to those creating extensions.
Data contained:
- level
-
The integer level of the log event. Use LNAMES to get the actual level name.
- tracer
-
The execution stack returned by
caller
at the log event. It is nil if the invoked Logger’s trace is false. - data
-
The object that was passed into the logging method.
- name
-
The name of the logger that was invoked.
- fullname
-
The fully qualified name of the logger that was invoked.
Note that creating timestamps is a task left to formatters.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#fullname ⇒ Object
readonly
Returns the value of attribute fullname.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tracer ⇒ Object
readonly
Returns the value of attribute tracer.
Instance Method Summary collapse
-
#initialize(level, logger, tracer, data) ⇒ LogEvent
constructor
A new instance of LogEvent.
Constructor Details
#initialize(level, logger, tracer, data) ⇒ LogEvent
Returns a new instance of LogEvent.
23 24 25 26 |
# File 'lib/log4r-color/logevent.rb', line 23 def initialize(level, logger, tracer, data) @level, @tracer, @data = level, tracer, data @name, @fullname = logger.name, logger.fullname end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
22 23 24 |
# File 'lib/log4r-color/logevent.rb', line 22 def data @data end |
#fullname ⇒ Object (readonly)
Returns the value of attribute fullname.
22 23 24 |
# File 'lib/log4r-color/logevent.rb', line 22 def fullname @fullname end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
22 23 24 |
# File 'lib/log4r-color/logevent.rb', line 22 def level @level end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
22 23 24 |
# File 'lib/log4r-color/logevent.rb', line 22 def name @name end |
#tracer ⇒ Object (readonly)
Returns the value of attribute tracer.
22 23 24 |
# File 'lib/log4r-color/logevent.rb', line 22 def tracer @tracer end |